-
Notifications
You must be signed in to change notification settings - Fork 31
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
all: rework genesis api #567
all: rework genesis api #567
Conversation
* core: store genesis allocation and recommit them if necessary * core: recover predefined genesis allocation if possible
3e39d2a
to
f5a3df0
Compare
* all: polish tests * core: apply feedback from Guillaume * core: fix comment
f5a3df0
to
94f0fb7
Compare
Founding some places impacted to rewind logic here, maybe need to retest again after merging.
|
genesis = DefaultGoerliGenesisBlock() | ||
case params.SepoliaGenesisHash: | ||
genesis = DefaultSepoliaGenesisBlock() | ||
} |
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.
Could u recheck all params when recommit genesis to disk?
statedb.SetState(addr, key, value) | ||
} | ||
} | ||
root := statedb.IntermediateRoot(false) |
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.
Is it safe to remove the recalculated root in this line?
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.
root, err := g.Alloc.flush(db)
if err != nil {
panic(err)
}
The root is calculated by flush logic which is committed, so we don't need to callI IntermediateRoot here 🤔
I rechecked the logic of refactoring, seem it's safe for merging. LGTM. |
f69fce6
into
axieinfinity:path-base-implementing
* core: store genesis allocation and recommit them if necessary (#24460) * core: store genesis allocation and recommit them if necessary * core: recover predefined genesis allocation if possible * all: cleanup the APIs for initializing genesis (#25473) * all: polish tests * core: apply feedback from Guillaume * core: fix comment --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* core: store genesis allocation and recommit them if necessary (#24460) * core: store genesis allocation and recommit them if necessary * core: recover predefined genesis allocation if possible * all: cleanup the APIs for initializing genesis (#25473) * all: polish tests * core: apply feedback from Guillaume * core: fix comment --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
* core: store genesis allocation and recommit them if necessary (#24460) * core: store genesis allocation and recommit them if necessary * core: recover predefined genesis allocation if possible * all: cleanup the APIs for initializing genesis (#25473) * all: polish tests * core: apply feedback from Guillaume * core: fix comment --------- Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This PR refers to the 2 following PRs:
ToBlock
is now only used to generate genesis block, since we haveFlush
to write to dbGenesisBlockForTesting