Skip to content
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(vm): stateful precompiles #10

Merged
merged 14 commits into from
Jan 30, 2023
Merged

feat(vm): stateful precompiles #10

merged 14 commits into from
Jan 30, 2023

Conversation

fedekunze
Copy link

@fedekunze fedekunze commented Jan 17, 2023

This PR adds support for stateful precompiles. In particular:

  • Add NewPrecompile function to reuse the vm.Contract values
  • Updates existing precompiles to use contract.Input
  • Defines a RunPrecompile function in the EVM to Run the active precompiles defined in the EVM fields
  • Adds a IsStateful() bool to the PrecompileContract interface
  • Updates the Run function PrecompileContract function to the following to support stateful precompiles:
Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error)

@fedekunze fedekunze marked this pull request as ready for review January 30, 2023 13:01
@fedekunze fedekunze merged commit b5cd235 into master Jan 30, 2023
@fedekunze fedekunze deleted the fedekunze/run-stateful branch January 30, 2023 17:32
@fedekunze
Copy link
Author

@Mergifyio backport release/1.10

@mergify
Copy link

mergify bot commented Jan 31, 2023

backport release/1.10

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 31, 2023
(cherry picked from commit b5cd235)

# Conflicts:
#	CHANGELOG.md
#	core/vm/contracts.go
#	core/vm/evm.go
fedekunze added a commit that referenced this pull request Feb 3, 2023
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants