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

Adding ability to fork EVM blockchain to do things like test transactions #254

Merged
merged 16 commits into from
Oct 14, 2022

Conversation

joecroninallen
Copy link
Contributor

Description
We are adding the ability to fork any EVM blockchain (using foundry's anvil). This can be used for doing things like validating transactions.

Additional context
This PR simply provides a generic way to fork an EVM blockchain by passing in a url and blockchain id.
We have the anvil binary embedded and we take the binary bytes from that and create an executable file and run that.
Then, the user can provide a callback function that takes a client handle to the forked blockchain, which allows the user to submit transactions and make calls to the forked blockchain.
This can be used to validate transactions for example before broadcasting to the main blockchain.

Metadata

@github-actions github-actions bot added go Pull requests that update Go code M-ci Module: CI labels Oct 13, 2022
@codecov
Copy link

codecov bot commented Oct 13, 2022

The author of this PR, joecroninallen, is not an activated member of this organization on Codecov.
Please activate this user on Codecov to display this PR comment.
Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.
Please don't hesitate to email us at support@codecov.io with any questions.

ethergo/forker/fork.go Outdated Show resolved Hide resolved
s := bufio.NewScanner(reader)

for s.Scan() {
// TODO: make this exhautive
Copy link
Contributor

@nautsimon nautsimon Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trajan0x is this todo for this PR?

Copy link
Contributor

@nautsimon nautsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@joecroninallen joecroninallen merged commit b67fdbb into master Oct 14, 2022
@joecroninallen joecroninallen deleted the feat/forker branch October 14, 2022 00:30
@trajan0x trajan0x restored the feat/forker branch October 14, 2022 20:20
@trajan0x trajan0x deleted the feat/forker branch March 28, 2023 19:19
@trajan0x trajan0x mentioned this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code M-ci Module: CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OmniRPC Sanity Checks (Iron Dome)
3 participants