Skip to content

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

Merged
karalabe merged 1 commit intoethereum:masterfrom
karalabe:txpool-noncer
Jul 9, 2019
Merged

core: kill off managed state, use own tiny noncer for txpool#19810
karalabe merged 1 commit intoethereum:masterfrom
karalabe:txpool-noncer

Conversation

@karalabe
Copy link
Copy Markdown
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
Copy Markdown
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