-
Notifications
You must be signed in to change notification settings - Fork 93
chore: update gas validation for pectra upgrade #4686
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Test Results 20 files ±0 272 suites ±0 21m 40s ⏱️ ±0s Results for commit 564e291. ± Comparison against base commit 2e9648a. This pull request removes 2 tests.♻️ This comment has been updated with latest results. |
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
| expect(nonceLatest).to.equal(noncePending); | ||
| }); | ||
|
|
||
| it('should have equal nonces (pending and latest) after CN reverted transaction', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed test: This test relied on a transaction passing relay precheck but failing
at Consensus Node with INSUFFICIENT_GAS. After implementing EIP-7623 and EIP-3860
(contract creation cost), the relay now correctly calculates intrinsic gas including
contract creation overhead (73,806 vs 41,484), catching this case at precheck level, so we want achieve the revert on CN and we alrady have other tests failing for CONTRACT_REVERT that test the desired behaviour of pending and latest nonces https://github.com/hiero-ledger/hiero-json-rpc-relay/pull/4686/files#diff-eaa3ef5444041f9a635e11c9d1137963b53436c9a1949faf37c903a4c74300eaR995
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
simzzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, just left one question
| const contractCall = '0xcfae3217'; | ||
| const transfer = '0x'; | ||
| const invalidTx = '0x60806040523480156200001157600080fd5b'; | ||
| it('should be able to calculate small contract create', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Should we also add a test that verifies the floor price kicks in when floorPrice > standardIntrinsicGas?
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #4686 +/- ##
==========================================
- Coverage 95.47% 95.47% -0.01%
==========================================
Files 129 129
Lines 20928 20973 +45
Branches 1793 1799 +6
==========================================
+ Hits 19982 20024 +42
- Misses 926 929 +3
Partials 20 20
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Description
Updates the
transactionIntrinsicGasCostmethod to align with Ethereum's Pectra upgrade specifications.Changes
EIP-7623: Calldata Floor Pricing
Added floor price validation to prevent underpriced data-heavy transactions:
floorPrice = 21000 + 10 × tokenstokens = zeroBytes + nonZeroBytes × 4EIP-3860: Contract Creation Cost
Added initcode cost for contract deployment transactions:
contractCreationCost = 32000 + 2 × words(calldata)EIP-7702: Authorization List
Added support for type 4 transaction authorization list costs:
authListCost = 25000 × authorizationList.lengthImplementation Details
transactionIntrinsicGasCost(data: string)totransactionIntrinsicGasCost(tx: Transaction)TOTAL_COST_FLOOR_PER_TOKEN,INITCODE_WORD_COST,PER_EMPTY_ACCOUNT_COSTContractService.tsto use new method signatureReferences
Related issue(s)
Fixes #4659
Testing Guide
Changes from original design (optional)
N/A
Additional work needed (optional)
N/A
Checklist