-
Notifications
You must be signed in to change notification settings - Fork 9
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] Working prototype #85
Conversation
dd122db
to
8850e6c
Compare
74fb259
to
6c8167f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR lacks proper unit testing.
Especially decode.go
has some parts which we should make sure no one changes by adding test.
a44d970
to
3627d2a
Compare
e1c967b
to
7f435fb
Compare
Co-authored-by: cabrador <84449820+cabrador@users.noreply.github.com>
3627d2a
to
e0d0de9
Compare
462db90
to
bf429ad
Compare
db/substate_encoding.go
Outdated
// encodeSubstate defensively defaults to "default" if nil | ||
func (db *substateDB) encodeSubstate(ss *substate.Substate, block uint64, tx int) ([]byte, error) { | ||
if db.encoding == nil { | ||
db.SetSubstateEncoding("default") | ||
} | ||
return db.encoding.encode(ss, block, tx) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I think implementation details does not belong to a func comment.
Second, do you think we should have this condition? I think this belongs into the factory func.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defensive defaults now removed in favor of having SetSubstate("default")
in all public constructor of substateDB
.
79974a4
I understand the performance reason to do this, but this leaves direct instantiation of &substateDB{...}
(in tests, for example) to panic if encoding is never set. Any advice on this?
comments on encode***( Co-authored-by: cabrador <84449820+cabrador@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for iterating through this PR. lgtm now!
Currently, geth transactions were recorded using RLP. The record-replay has switched to Protobuf instead, with 18M block onwards having only the Protobuf recording.
This change would allow substate to read Protobuf messages from disk along side RLP.
Todo: Create a decode function that takes a flag to select RLP/Protobuf
Note: Protobuf encode function is not implemented, but should be straight forward.
Type of change