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

Fix logic bug in txPool.validate #2441

Merged
merged 4 commits into from
Dec 7, 2022
Merged

Fix logic bug in txPool.validate #2441

merged 4 commits into from
Dec 7, 2022

Conversation

acolytec3
Copy link
Contributor

Fixes a logic bug in the txPool.validate function where we are retrieving an account balance from the wrong vm and stateManager instance. This caused an issue where txPool.validate would fail when submitting a transaction via the RPC eth_sendRawTransaction endpoint after restarting the client on an existing stateDB where no transactions/blocks were being run. setStateRoot was being called on the vmCopy but the account balance was being retrieved from the vm.stateManager which had an unknown stateroot and the account might not have the correct balance.

@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Merging #2441 (8e9c82b) into master (b6a896b) will increase coverage by 1.74%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 89.51% <ø> (ø)
blockchain 90.03% <ø> (ø)
client 87.47% <100.00%> (ø)
common 98.17% <ø> (ø)
devp2p 91.70% <ø> (+0.08%) ⬆️
ethash ?
evm ?
rlp ∅ <ø> (∅)
statemanager 89.61% <ø> (ø)
trie 90.36% <ø> (ø)
tx 97.80% <ø> (ø)
util 84.59% <ø> (ø)
vm 85.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

gabrocheleau
gabrocheleau previously approved these changes Dec 5, 2022
Copy link
Contributor

@gabrocheleau gabrocheleau left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@acolytec3
Copy link
Contributor Author

Fixed the other broken client test here. Should be ready for final review.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Cool, nice find 🙂, LGTM! 👍

@holgerd77 holgerd77 merged commit ea4288e into master Dec 7, 2022
@holgerd77 holgerd77 deleted the txPook-logic-bug branch December 7, 2022 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants