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

core: kill off managed state, use own tiny noncer for txpool #19810

Merged
merged 1 commit into from
Jul 9, 2019

Conversation

karalabe
Copy link
Member

@karalabe karalabe commented Jul 9, 2019

We had some ancient legacy code called state.ManagedState that was supposed to be a "virtual, in-memory" clone of a state.StateDB for the transaction pool. This managed state had a lot of weird unused code (probably originally it was meant to be something else). The only thing the txpool needed was to set and get nonces.

Not only did state.ManagedState have more code than needed, it also directly called SetNonce on the underlying state database, which triggered the state journal. With the correct circumstances, this resulted in memory overhead that could lead to a crash if no chain head arrived fast enough.

This PR murders the managed state altogether, and replaces it with a tiny, simple construct with only the things we need for the txpool.

@karalabe karalabe added this to the 1.9.0 milestone Jul 9, 2019
Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

LGTM

@karalabe karalabe merged commit 8c249cb into ethereum:master Jul 9, 2019
@gzliudan gzliudan mentioned this pull request May 7, 2024
19 tasks
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request May 10, 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.

2 participants