Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Protobuf] add a way to switch between RLP and Protobuf for substateDB decoding #87

Closed
wants to merge 7 commits into from

Conversation

rpl-ffl
Copy link
Collaborator

@rpl-ffl rpl-ffl commented Sep 23, 2024

Squashed from #86

Add a builder function SetDecoder(encoding string) to substateDB and SubstateDB interface so that a decoder type can be selected.
A substateDB can decode using decodeRlp or decodeProtobuf. It defaults to decodeRlp to preserve original functionality.

Example usage:

db := (&substateDB{...})          // initializing db as normal, this defaults to RLP
         .SetDecoder(<encoding>)  // at end of init (or before decoding) to switch between RLP/Protobuf

Type of change

  • New feature (non-breaking change which adds functionality)

@rpl-ffl rpl-ffl changed the title [Feature] add a way to switch between RLP and Protobuf for substateDB decoding [Protobuf] add a way to switch between RLP and Protobuf for substateDB decoding Sep 23, 2024
Copy link
Contributor

@cabrador cabrador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add unit tests.

db/substate_decoder.go Outdated Show resolved Hide resolved
db/substate_decoder.go Outdated Show resolved Hide resolved
db/substate_db.go Outdated Show resolved Hide resolved
Co-authored-by: cabrador <84449820+cabrador@users.noreply.github.com>
@rpl-ffl
Copy link
Collaborator Author

rpl-ffl commented Sep 24, 2024

Deprecated in favor of #88, as discussed.

@rpl-ffl rpl-ffl closed this Sep 24, 2024
@rpl-ffl rpl-ffl mentioned this pull request Sep 25, 2024
1 task
@rpl-ffl rpl-ffl deleted the rapol/feature/switch-pb-rlp branch October 1, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants