-
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
fix: remove ineffective witness assignment #463
base: kaustinen-with-shapella
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -192,7 +192,7 @@ func (s *StateDB) NewAccessWitness() *AccessWitness { | |||||||
|
||||||||
func (s *StateDB) Witness() *AccessWitness { | ||||||||
if s.witness == nil { | ||||||||
s.witness = s.NewAccessWitness() | ||||||||
panic("witness wasn't initialized") | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
} | ||||||||
return s.witness | ||||||||
} | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,9 +137,6 @@ func NewEVM(blockCtx BlockContext, txCtx TxContext, statedb StateDB, chainConfig | |
chainConfig: chainConfig, | ||
chainRules: chainConfig.Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time), | ||
} | ||
if txCtx.Accesses == nil && chainConfig.IsPrague(blockCtx.BlockNumber, blockCtx.Time) { | ||
evm.Accesses = evm.StateDB.(*state.StateDB).NewAccessWitness() | ||
} | ||
Comment on lines
-140
to
-142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this stuff is recreated in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've checked all references to I feel it would be much safer to maybe move that initialization inside Also noted that that referenced line doesn't do the If we're always fine with doing it ignoring the right fork (as done today in |
||
evm.interpreter = NewEVMInterpreter(evm) | ||
return evm | ||
} | ||
|
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 had the feeling this removed logic was intentionally trying to lazily initialize in some cases.
Thing is that if we remove this, we could panic "for a while" but eventually this method will have to change to returning
*AccessWitnes, error
. (Or avoid theif
check?)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.
yes the if check should not be necessary, I am just setting the panic to catch a rebase issue. I'll add a TODO here.