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

Tx: Cache sender #2985

Merged
merged 3 commits into from
Aug 24, 2023
Merged

Tx: Cache sender #2985

merged 3 commits into from
Aug 24, 2023

Conversation

jochem-brouwer
Copy link
Member

@jochem-brouwer jochem-brouwer commented Aug 23, 2023

I did a test profile run and noticed that especially ecrecover takes relatively long. We should only do this once for frozen txs, since the sender cannot change.

Note: this halves the amount of ecrecover calls in VM's runBlock (two calls: first in block.validateData which tx.getValidationErrors which checks the signature, and then in runTx because we need to see if the sender has enough data, and of course have to setup EVMs ORIGIN / CALLER for the transaction).

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #2985 (5c0cc6a) into master (f5dcf4a) will increase coverage by 0.08%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.66% <ø> (ø)
blockchain 92.58% <ø> (ø)
client 87.37% <ø> (ø)
common 98.61% <100.00%> (+0.05%) ⬆️
ethash ∅ <ø> (∅)
evm 70.43% <ø> (ø)
rlp ∅ <ø> (∅)
statemanager 84.43% <ø> (ø)
trie 90.03% <ø> (+0.50%) ⬆️
tx 95.97% <100.00%> (+0.09%) ⬆️
util 86.78% <ø> (ø)
vm 79.20% <ø> (ø)

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

Copy link
Contributor

@ScottyPoi ScottyPoi left a comment

Choose a reason for hiding this comment

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

Nice catch 👍

LGTM

@holgerd77
Copy link
Member

Yes, agree, great catch! 👍

Will merge.

@holgerd77 holgerd77 merged commit 66e79cc into master Aug 24, 2023
@holgerd77 holgerd77 deleted the tx-cache-sender branch August 24, 2023 11:23
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