Skip to content

Commit

Permalink
bump nim-eth for withdrawalsRoot support (#1326)
Browse files Browse the repository at this point in the history
The `BlockHeader` structure in `nim-eth` was updated with support for
EIP-4895 (withdrawals). To enable the `nim-eth` bump, the ingress of
`BlockHeader` structures has been hardened to reject headers that have
the new `withdrawalsRoot` field until proper withdrawals support exists.
status-im/nim-eth#562
  • Loading branch information
etan-status authored Nov 26, 2022
1 parent 7688148 commit bc3f164
Show file tree
Hide file tree
Showing 13 changed files with 223 additions and 71 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ nimcache
*.generated.nim
/dist

/all_test.md

# Nimble user files
nimble.develop
nimble.paths

# nimbus-build-system files
nimbus-build-system.paths

30 changes: 28 additions & 2 deletions TransactionTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,36 @@ OK: 4/4 Fail: 0/4 Skip: 0/4
+ dataTx_bcValidBlockTestFrontier.json OK
```
OK: 9/9 Fail: 0/9 Skip: 0/9
## ttEIP1559
```diff
+ GasLimitPriceProductOverflow.json OK
+ GasLimitPriceProductOverflowtMinusOne.json OK
+ GasLimitPriceProductPlusOneOverflow.json OK
+ maxFeePerGas00prefix.json OK
+ maxFeePerGas32BytesValue.json OK
+ maxFeePerGasOverflow.json OK
+ maxPriorityFeePerGas00prefix.json OK
+ maxPriorityFeePerGasOverflow.json OK
+ maxPriorityFeePerGass32BytesValue.json OK
```
OK: 9/9 Fail: 0/9 Skip: 0/9
## ttEIP2028
```diff
+ DataTestInsufficientGas2028.json OK
+ DataTestSufficientGas2028.json OK
```
OK: 2/2 Fail: 0/2 Skip: 0/2
## ttEIP2930
```diff
+ accessListAddressGreaterThan20.json OK
+ accessListAddressLessThan20.json OK
+ accessListAddressPrefix00.json OK
+ accessListStorage0x0001.json OK
+ accessListStorage32Bytes.json OK
+ accessListStorageOver32Bytes.json OK
+ accessListStoragePrefix00.json OK
```
OK: 7/7 Fail: 0/7 Skip: 0/7
## ttGasLimit
```diff
+ NotEnoughGasLimit.json OK
Expand Down Expand Up @@ -189,6 +213,8 @@ OK: 3/3 Fail: 0/3 Skip: 0/3
+ RLPNonceWithFirstZeros.json OK
+ RLPTransactionGivenAsArray.json OK
+ RLPValueWithFirstZeros.json OK
+ RLP_04_maxFeePerGas32BytesValue.json OK
+ RLP_09_maxFeePerGas32BytesValue.json OK
+ RLPgasLimitWithFirstZeros.json OK
+ RLPgasPriceWithFirstZeros.json OK
+ TRANSCT_HeaderGivenAsArray_0.json OK
Expand Down Expand Up @@ -233,7 +259,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3
+ aMaliciousRLP.json OK
+ tr201506052141PYTHON.json OK
```
OK: 57/57 Fail: 0/57 Skip: 0/57
OK: 59/59 Fail: 0/59 Skip: 0/59

---TOTAL---
OK: 190/190 Fail: 0/190 Skip: 0/190
OK: 208/208 Fail: 0/208 Skip: 0/208
3 changes: 3 additions & 0 deletions fluffy/network/history/history_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ func validateBlockHeaderBytes*(

let header = ? decodeRlp(bytes, BlockHeader)

if header.withdrawalsRoot.isSome:
return err("Withdrawals not yet implemented")

if not (header.blockHash() == hash):
err("Block header hash does not match")
else:
Expand Down
54 changes: 42 additions & 12 deletions newBlockchainTests.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
newBlockchainTests
===
## bcArrowGlacierToMerge
```diff
+ difficultyFormula.json OK
+ powToPosBlockRejection.json OK
+ powToPosTest.json OK
```
OK: 3/3 Fail: 0/3 Skip: 0/3
## bcBerlinToLondon
```diff
+ BerlinToLondonTransition.json OK
Expand Down Expand Up @@ -29,6 +36,7 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
+ baseFee.json OK
+ besuBaseFeeBug.json OK
+ burnVerify.json OK
+ burnVerifyLondon.json OK
+ checkGasLimit.json OK
+ feeCap.json OK
+ gasLimit20m.json OK
Expand All @@ -40,21 +48,29 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
+ lowDemand.json OK
+ medDemand.json OK
+ tips.json OK
+ tipsLondon.json OK
+ transFail.json OK
+ transType.json OK
+ valCausesOOF.json OK
```
OK: 19/19 Fail: 0/19 Skip: 0/19
OK: 21/21 Fail: 0/21 Skip: 0/21
## bcEIP158ToByzantium
```diff
+ ByzantiumTransition.json OK
```
OK: 1/1 Fail: 0/1 Skip: 0/1
## bcEIP3675
```diff
+ timestampPerBlock.json OK
+ tipInsideBlock.json OK
```
OK: 2/2 Fail: 0/2 Skip: 0/2
## bcExample
```diff
+ basefeeExample.json OK
+ mergeExample.json OK
```
OK: 1/1 Fail: 0/1 Skip: 0/1
OK: 2/2 Fail: 0/2 Skip: 0/2
## bcExploitTest
```diff
DelegateCallSpam.json Skip
Expand Down Expand Up @@ -266,6 +282,7 @@ OK: 96/96 Fail: 0/96 Skip: 0/96
+ RefundOverflow.json OK
+ RefundOverflow2.json OK
+ SuicidesMixingCoinbase.json OK
+ SuicidesMixingCoinbase2.json OK
+ TransactionFromCoinbaseHittingBlockGasLimit1.json OK
+ TransactionFromCoinbaseNotEnoughFounds.json OK
+ TransactionNonceCheck.json OK
Expand Down Expand Up @@ -299,6 +316,7 @@ OK: 96/96 Fail: 0/96 Skip: 0/96
+ extcodehashEmptySuicide.json OK
+ logRevert.json OK
+ multimpleBalanceInstruction.json OK
+ random.json OK
+ randomStatetest123.json OK
+ randomStatetest136.json OK
+ randomStatetest160.json OK
Expand Down Expand Up @@ -344,7 +362,7 @@ OK: 96/96 Fail: 0/96 Skip: 0/96
+ transactionFromSelfDestructedContract.json OK
+ txCost-sec73.json OK
```
OK: 87/88 Fail: 0/88 Skip: 1/88
OK: 89/90 Fail: 0/90 Skip: 1/90
## bcTotalDifficultyTest
```diff
+ lotsOfBranchesOverrideAtTheEnd.json OK
Expand Down Expand Up @@ -405,6 +423,7 @@ OK: 9/9 Fail: 0/9 Skip: 0/9
## bcUncleTest
```diff
+ EqualUncleInTwoDifferentBlocks.json OK
+ EqualUncleInTwoDifferentBlocks2.json OK
+ InChainUncle.json OK
+ InChainUncleFather.json OK
+ InChainUncleGrandPa.json OK
Expand All @@ -427,7 +446,7 @@ OK: 9/9 Fail: 0/9 Skip: 0/9
+ uncleHeaderWithGeneration0.json OK
+ uncleWithSameBlockNumber.json OK
```
OK: 22/22 Fail: 0/22 Skip: 0/22
OK: 23/23 Fail: 0/23 Skip: 0/23
## bcValidBlockTest
```diff
+ ExtraData32.json OK
Expand Down Expand Up @@ -730,8 +749,9 @@ OK: 5/5 Fail: 0/5 Skip: 0/5
+ callcodecallcodecallcode_111_SuicideEnd.json OK
+ callcodecallcodecallcode_111_SuicideMiddle.json OK
callcodecallcodecallcode_ABCB_RECURSIVE.json Skip
+ touchAndGo.json OK
```
OK: 72/79 Fail: 0/79 Skip: 7/79
OK: 73/80 Fail: 0/80 Skip: 7/80
## stCallCreateCallCodeTest
```diff
Call1024BalanceTooLow.json Skip
Expand Down Expand Up @@ -1006,6 +1026,7 @@ OK: 51/52 Fail: 0/52 Skip: 1/52
+ CREATE_HighNonceMinus1.json OK
+ CREATE_empty000CreateinInitCode_Transaction.json OK
+ CodeInConstructor.json OK
+ CreateAddressWarmAfterFail.json OK
+ CreateCollisionResults.json OK
+ CreateCollisionToEmpty.json OK
+ CreateOOGFromCallRefunds.json OK
Expand All @@ -1019,12 +1040,14 @@ OK: 51/52 Fail: 0/52 Skip: 1/52
+ CreateOOGafterInitCodeRevert2.json OK
+ CreateOOGafterMaxCodesize.json OK
+ CreateResults.json OK
+ CreateTransactionHighNonce.json OK
+ TransactionCollisionToEmpty.json OK
+ TransactionCollisionToEmptyButCode.json OK
+ TransactionCollisionToEmptyButNonce.json OK
+ createFailResult.json OK
+ createLargeResult.json OK
```
OK: 41/41 Fail: 0/41 Skip: 0/41
OK: 44/44 Fail: 0/44 Skip: 0/44
## stDelegatecallTestHomestead
```diff
Call1024BalanceTooLow.json Skip
Expand Down Expand Up @@ -1128,12 +1151,13 @@ OK: 40/40 Fail: 0/40 Skip: 0/40
+ lowGasPriceOldTypes.json OK
+ outOfFunds.json OK
+ outOfFundsOldTypes.json OK
+ senderBalance.json OK
+ tipTooHigh.json OK
+ transactionIntinsicBug.json OK
+ typeTwoBerlin.json OK
+ valCausesOOF.json OK
```
OK: 12/12 Fail: 0/12 Skip: 0/12
OK: 13/13 Fail: 0/13 Skip: 0/13
## stEIP158Specific
```diff
+ CALL_OneVCallSuicide.json OK
Expand Down Expand Up @@ -1175,11 +1199,12 @@ OK: 5/5 Fail: 0/5 Skip: 0/5
+ indexesOmitExample.json OK
+ invalidTr.json OK
+ labelsExample.json OK
+ mergeTest.json OK
+ rangesExample.json OK
+ solidityExample.json OK
+ yulExample.json OK
```
OK: 11/11 Fail: 0/11 Skip: 0/11
OK: 12/12 Fail: 0/12 Skip: 0/12
## stExtCodeHash
```diff
+ callToNonExistent.json OK
Expand Down Expand Up @@ -1457,6 +1482,7 @@ OK: 24/24 Fail: 0/24 Skip: 0/24
## stPreCompiledContracts
```diff
+ blake2B.json OK
+ delegatecall09Undefined.json OK
+ idPrecomps.json OK
+ identity_to_bigger.json OK
+ identity_to_smaller.json OK
Expand All @@ -1465,7 +1491,7 @@ OK: 24/24 Fail: 0/24 Skip: 0/24
+ precompsEIP2929.json OK
+ sec80.json OK
```
OK: 8/8 Fail: 0/8 Skip: 0/8
OK: 9/9 Fail: 0/9 Skip: 0/9
## stPreCompiledContracts2
```diff
+ CALLBlake2f.json OK
Expand Down Expand Up @@ -1533,6 +1559,7 @@ OK: 8/8 Fail: 0/8 Skip: 0/8
+ CallEcrecoverS_prefixed0.json OK
+ CallEcrecoverUnrecoverableKey.json OK
+ CallEcrecoverV_prefixed0.json OK
+ CallEcrecover_Overflow.json OK
+ CallIdentitiy_0.json OK
+ CallIdentitiy_1.json OK
+ CallIdentity_1_nonzeroValue.json OK
Expand Down Expand Up @@ -1562,13 +1589,15 @@ OK: 8/8 Fail: 0/8 Skip: 0/8
+ CallSha256_4.json OK
+ CallSha256_4_gas99.json OK
+ CallSha256_5.json OK
+ ecrecoverShortBuff.json OK
+ ecrecoverWeirdV.json OK
+ modexpRandomInput.json OK
+ modexp_0_0_0_20500.json OK
+ modexp_0_0_0_22000.json OK
+ modexp_0_0_0_25000.json OK
+ modexp_0_0_0_35000.json OK
```
OK: 99/99 Fail: 0/99 Skip: 0/99
OK: 102/102 Fail: 0/102 Skip: 0/102
## stQuadraticComplexityTest
```diff
Call1MB1024Calldepth.json Skip
Expand Down Expand Up @@ -2772,6 +2801,7 @@ OK: 13/13 Fail: 0/13 Skip: 0/13
+ currentAccountBalance.json OK
+ doubleSelfdestructTest.json OK
+ doubleSelfdestructTest2.json OK
+ doubleSelfdestructTouch.json OK
+ extcodecopy.json OK
+ return0.json OK
+ return1.json OK
Expand All @@ -2786,7 +2816,7 @@ OK: 13/13 Fail: 0/13 Skip: 0/13
+ suicideSendEtherToMe.json OK
+ testRandomTest.json OK
```
OK: 56/66 Fail: 0/66 Skip: 10/66
OK: 57/67 Fail: 0/67 Skip: 10/67
## stTimeConsuming
```diff
CALLBlake2f_MaxRounds.json Skip
Expand Down Expand Up @@ -3306,4 +3336,4 @@ OK: 0/3 Fail: 0/3 Skip: 3/3
OK: 11/11 Fail: 0/11 Skip: 0/11

---TOTAL---
OK: 2859/2964 Fail: 0/2964 Skip: 105/2964
OK: 2881/2986 Fail: 0/2986 Skip: 105/2986
Loading

0 comments on commit bc3f164

Please sign in to comment.