-
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
Test Results 19 files + 15 263 suites - 361 22m 35s ⏱️ + 21m 29s For more details on these failures, see this check. Results for commit df07b47. ± Comparison against base commit 1a6b3ca. This pull request removes 2196 and adds 780 tests. Note that renamed tests count towards both.This pull request removes 2 skipped tests and adds 4 skipped tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
| 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
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?
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.
added
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
564e291 to
3162ac0
Compare
Signed-off-by: Konstantina Blazhukova <[email protected]>
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #4686 +/- ##
==========================================
- Coverage 95.68% 95.67% -0.02%
==========================================
Files 137 137
Lines 21544 21595 +51
Branches 1802 1804 +2
==========================================
+ Hits 20615 20660 +45
- Misses 910 916 +6
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 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