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

Remove ReadOnlyStateDB, rely on StaticCall #200

Closed
wants to merge 1 commit into from

Conversation

karlb
Copy link

@karlb karlb commented Aug 7, 2024

I has been stated that StaticCall can do modifications to the state in multiple places in the geth code base. Therefore, we first did a copy of the state to avoid changes and later switched to used the ReadOnlyStateDB to achieve the same result with better performance.

Upon closer examination, the only state change that StaticCall actually does is "touching" the called address, which only makes a difference on legacy Ethereum chains, but not on Celo chains. So we can skip the ReadOnlyStateDB and rely on StaticCall to ensure that no changes to the state are done.

The read-only-guarantee is less obvious with StaticCall, but considering the problems brought up in
https://github.com/celo-org/celo-blockchain-planning/issues/355, the reduction in code size and the full support for all read-only operations, this looks like a clear improvement.

With the removal of ReadOnlyStateDB, further testing of it is pointless: Closes https://github.com/celo-org/celo-blockchain-planning/issues/355

I has been stated that StaticCall can do modifications to the state in
multiple places in the geth code base. Therefore, we first did a copy of
the state to avoid changes and later switched to used the
ReadOnlyStateDB to achieve the same result with better performance.

Upon closer examination, the only state change that StaticCall actually
does is "touching" the called address, which only makes a difference on
legacy Ethereum chains, but not on Celo chains. So we can skip the
ReadOnlyStateDB and rely on StaticCall to ensure that no changes to the
state are done.

The read-only-guarantee is less obvious with StaticCall, but considering
the problems brought up in
celo-org/celo-blockchain-planning#355, the
reduction in code size and the full support for all read-only
operations, this looks like a clear improvement.

With the removal of ReadOnlyStateDB, further testing of it is pointless:
Closes celo-org/celo-blockchain-planning#355
@karlb
Copy link
Author

karlb commented Aug 7, 2024

This missed the fact that access list tracking is still done. Closing in favor of #201.

@karlb karlb closed this Aug 7, 2024
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.

1 participant