-
Notifications
You must be signed in to change notification settings - Fork 30
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 EIP-7623 gas calculation and tests #217
Open
2dvorak
wants to merge
6
commits into
kaiachain:dev
Choose a base branch
from
2dvorak:2dvorak/add-eip7623-test
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+293
−148
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hyunsooda
reviewed
Jan 22, 2025
hyeonLewis
reviewed
Jan 22, 2025
2dvorak
requested review from
blukat29,
yoomee1313 and
ian0371
as code owners
January 24, 2025 04:38
9 tasks
hyeonLewis
reviewed
Jan 24, 2025
Is |
@hyeonLewis Yes, I've updated the description. Thank you! |
2dvorak
force-pushed
the
2dvorak/add-eip7623-test
branch
from
January 24, 2025 10:48
f5b3768
to
832b10a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR fixes gas calculation logic for EIP-7623 changes introduced in #200
Also, this PR fixes gas calculation tests accordingly.
Added state transition test for EIP-7623.
Kaia-specific gas calculation logic
EIP-7623 states that the new formula for gas calculation as follows:
Geth's implementation for above formula is:
However Kaia has different
TxGas
for different tx types, for example fee delegated tx has21000 + 10000
.That would make our implementation:
Furthermore, we have additional gas for signature validation for fee delegated tx.
That would further complicate our implementation to:
Impact on our code
As a result, our code for intrinsic gas changed from:
to:
because we need
SigValidateGas
for gas comparisonmax(total_gas_used, tx_gas_per_tx_type + sig_validation_gas + floor_gas)
Note that unrelated fields or variables are omitted for brevity.
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
I have read the CLA Document and I hereby sign the CLA
in first time contribute$ make test
)Related issues
#200