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(anvil): add mined transactions to state dump #8411

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

tuler
Copy link
Contributor

@tuler tuler commented Jul 11, 2024

Motivation

Fixes #8213
Closes: #7955

Solution

This PR adds the mined transactions that are already part of the memory storage to the file produced by --dump-state and loaded by --load-state.

If transactions are not persisted and loaded, queries for full blocks fail.

@tuler
Copy link
Contributor Author

tuler commented Jul 11, 2024

Need help figuring out what is the easiest way to create a new MinedTransaction to augment the test case test_storage_dump_reload_cycle

@tuler
Copy link
Contributor Author

tuler commented Jul 11, 2024

It seems this still has a problem with impersonated transactions.
If I send an impersonated transactions the hash of blocks[1].transactions[0].EIP1559.hash is not the same as the hash of the mined transaction at transactions[0].info.transaction_hash

@tuler
Copy link
Contributor Author

tuler commented Jul 11, 2024

Problem of impersonated transactions is solved, at the cost of breaking compatibility with previous dump format.
Solved by serializing the MaybeImpersonatedTransaction instead of the TypedTransaction transaction only, which now includes the impersonated_sender

@tuler tuler marked this pull request as ready for review July 11, 2024 18:10
@tuler tuler force-pushed the dump-transactions branch 4 times, most recently from a1dba58 to f78df87 Compare July 16, 2024 02:58
@zerosnacks
Copy link
Member

zerosnacks commented Jul 16, 2024

Hi @tuler thanks for your PR!

Looks like this may also resolve this feature request: #7955

@tuler tuler force-pushed the dump-transactions branch 3 times, most recently from 836d790 to 707bff3 Compare July 17, 2024 12:32
@tuler
Copy link
Contributor Author

tuler commented Jul 17, 2024

@mattsse ptal

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this works, ty!

@tuler
Copy link
Contributor Author

tuler commented Jul 18, 2024

@zerosnacks not sure what is the contribution workflow here. Can it be merged? Need more review?

@mattsse mattsse merged commit 31628d1 into foundry-rs:master Jul 18, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants