-
Notifications
You must be signed in to change notification settings - Fork 220
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
wip: use libevm (params, core/vm) #1335
base: master
Are you sure you want to change the base?
Conversation
95ce588
to
8574ab3
Compare
simplify nit: spelling
cc7d5e6
to
932967d
Compare
|
||
// Durango enables the Shanghai upgrade of eth, which takes place after the | ||
// Merge upgrade. | ||
isDurango := params.GetExtra(chain.Config()).IsDurango(header.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.
upstream avoids this dependency here (on chain config/rules) by checking if Difficulty is 0,
but we cannot rely on that because we already made blocks with difficulty set to 1.
chainConfig *gethparams.ChainConfig | ||
blockContext *BlockContext | ||
} | ||
|
||
func (a accessableState) GetStateDB() contract.StateDB { | ||
// XXX: Whoa, this is a hack | ||
return a.StateDB.(contract.StateDB) | ||
return a.StateReader.(contract.StateDB) |
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 this just to make it compliant with an existing interface?
To guarantee that it's safe, without using the , ok
idiom you could:
var (
sr libevm.StateReader = a.StateReader
_ contract.StateDB = (libevm.StateReader)(nil) // prove that the next line won't panic
)
return sr.(contract.StateDB)
It's gross, but at least it's temporary!
initial attempt to use libevm params extensions