-
Notifications
You must be signed in to change notification settings - Fork 13
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
eip2935 redesign: insert all 256 ancestors upon transition #362
eip2935 redesign: insert all 256 ancestors upon transition #362
Conversation
@@ -184,6 +184,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig, | |||
misc.ApplyDAOHardFork(statedb) | |||
} | |||
if chainConfig.IsPrague(big.NewInt(int64(pre.Env.Number)), pre.Env.Timestamp) { | |||
// XXX figure out what to do for older hashes? |
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.
note to self: figure out what to do in this case.
core/state_processor.go
Outdated
@@ -87,7 +87,12 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg | |||
signer = types.MakeSigner(p.config, header.Number, header.Time) | |||
) | |||
if p.config.IsPrague(block.Number(), block.Time()) { | |||
ProcessParentBlockHash(statedb, block.NumberU64()-1, block.ParentHash()) | |||
parent := p.bc.GetBlockByHash(block.ParentHash()) | |||
if p.config.IsPrague(parent.Number(), parent.Time()) { |
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.
Shouldn't say if !...
?
core/state_processor.go
Outdated
ancestor := chain.GetHeader(prevHash, prevNumber) | ||
for i := prevNumber; i > 0 && i >= prevNumber-256; i-- { | ||
ProcessParentBlockHash(statedb, i, ancestor.Hash()) | ||
ancestor = chain.GetHeader(ancestor.ParentHash, ancestor.Number.Uint64()) |
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.
Shouldn't say: ancestor = chain.GetHeader(ancestor.ParentHash, ancestor.Number.Uint64()-1)
?
Or also ancestor = chain.GetHeader(ancestor.ParentHash, i-1)
* eip2935 redesign: only read target block hash * review fixes * fix: t8n tool
* eip2935 redesign: only read target block hash * review fixes * fix: t8n tool
* eip2935 redesign: only read target block hash * review fixes * fix: t8n tool
This is a rewrite of eip 2935 after it was suggested to simply insert all block hash values at fork time, instead of reading the 256th ancestor and using a complex fallback mechanism.