-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: precompiled contract poc #1
feat: precompiled contract poc #1
Conversation
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.
-
It's better to mention the cherry-picked commits for follow-up.
It seems to be based on the commit -
There isn't much information on what is resolved by this fix, but it needs to be checked.
-
Please check if the code should be changed to
vm.DefaultActivePrecompiles
go-ethereum/core/vm/runtime/runtime.go
Line 132 in 9dcf8aa
cfg.State.Prepare(rules, cfg.Origin, cfg.Coinbase, &address, vm.ActivePrecompiles(rules), nil)
go-ethereum/core/vm/runtime/runtime.go
Line 168 in 9dcf8aa
cfg.State.Prepare(rules, cfg.Origin, cfg.Coinbase, nil, vm.ActivePrecompiles(rules), nil)
go-ethereum/core/vm/runtime/runtime.go
Line 199 in 9dcf8aa
statedb.Prepare(rules, cfg.Origin, cfg.Coinbase, &address, vm.ActivePrecompiles(rules), nil)
this pr was done with reference to crypto-org-chain#12. i mentioned url in description.
for big2, there is a history of being added and removed. |
these have been changed to vmevm.ActivePrecompiles(rules) and also fixed the part of the test code that was causing the build to fail. |
LGTM |
I checked fix test build commit, and I think these three parts are not related to build failure. [Suggestion] |
@@ -1405,7 +1405,7 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH | |||
} | |||
isPostMerge := header.Difficulty.Cmp(common.Big0) == 0 | |||
// Retrieve the precompiles since they don't need to be added to the access list | |||
precompiles := vm.ActivePrecompiles(b.ChainConfig().Rules(header.Number, isPostMerge)) | |||
precompiles := vm.DefaultActivePrecompiles(b.ChainConfig().Rules(header.Number, isPostMerge)) |
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.
[Optional] If we use vmenv.ActivePrecompiles
instead of vm.DefaultActivePrecompiles
in go-ethereum/core/vm/runtime/runtime.go, I think same change should be applied to this part.
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 reverted changes in runtime.go.
Execute, Create, Call functions are performed via evm binary, which is the evm executor.
The point at which the precompiled contract address is added to the active precompiles list is when ethermint executes an evm tx, so there is no need to change to ActivePrecompiles in parts that do not have this access route.
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 have some suggestions but entirely, LGTM.
* feat: app level precompile * chore: Fix test build * chore: Remove usused var big2 * chore: Revert ActivePrecompiles to DefaultActivePrecompilestest: Fix gofumpt, gci
* feat: precompiled contract poc (#1) * feat: app level precompile * chore: Fix test build * chore: Remove usused var big2 * chore: Revert ActivePrecompiles to DefaultActivePrecompilestest: Fix gofumpt, gci * fix resolve * Merge pull request ethereum#18 from yihuang/release/v1.11.x go.mod: bump pebble db to official release --------- Co-authored-by: mmsqe <[email protected]> Co-authored-by: yihuang <[email protected]>
this changes are based on crypto-org-chain#12