@@ -95,18 +95,6 @@ var Tests = []test.Spec{
95
95
SlotsToSafe : big .NewInt (1 ),
96
96
SlotsToFinalized : big .NewInt (2 ),
97
97
},
98
-
99
- // PrevRandao opcode tests
100
- & test.BaseSpec {
101
- Name : "PrevRandao Opcode Transactions" ,
102
- Run : prevRandaoOpcodeTx ,
103
- TestTransactionType : helper .LegacyTxOnly ,
104
- },
105
- & test.BaseSpec {
106
- Name : "PrevRandao Opcode Transactions (EIP-1559 Transactions)" ,
107
- Run : prevRandaoOpcodeTx ,
108
- TestTransactionType : helper .DynamicFeeTxOnly ,
109
- },
110
98
}
111
99
112
100
// Test to verify Block information available after a reorg using forkchoiceUpdated
@@ -789,72 +777,7 @@ func buildPayloadWithInvalidChainIDTx(t *test.Env) {
789
777
790
778
}
791
779
792
- // TODO: Do a PENDING block suggestedFeeRecipient
793
-
794
- func checkPrevRandaoValue (t * test.Env , expectedPrevRandao common.Hash , blockNumber uint64 ) {
795
- storageKey := common.Hash {}
796
- storageKey [31 ] = byte (blockNumber )
797
- r := t .TestEngine .TestStorageAt (globals .PrevRandaoContractAddr , storageKey , nil )
798
- r .ExpectStorageEqual (expectedPrevRandao )
799
-
800
- }
801
-
802
- // PrevRandao Opcode tests
803
- func prevRandaoOpcodeTx (t * test.Env ) {
804
- t .CLMock .WaitForTTD ()
805
-
806
- // Send transactions in PoS, the value of the storage in these blocks must match the prevRandao value
807
- var (
808
- txCount = 10
809
- currentTxIndex = 0
810
- txs = make ([]typ.Transaction , 0 )
811
- )
812
- t .CLMock .ProduceBlocks (txCount , clmock.BlockProcessCallbacks {
813
- OnPayloadProducerSelected : func () {
814
- tx , err := t .SendNextTransaction (
815
- t .TestContext ,
816
- t .Engine ,
817
- & helper.BaseTransactionCreator {
818
- Recipient : & globals .PrevRandaoContractAddr ,
819
- Amount : big0 ,
820
- Payload : nil ,
821
- TxType : t .TestTransactionType ,
822
- GasLimit : 75000 ,
823
- ForkConfig : t .ForkConfig ,
824
- },
825
- )
826
- if err != nil {
827
- t .Fatalf ("FAIL (%s): Error trying to send transaction: %v" , t .TestName , err )
828
- }
829
- txs = append (txs , tx )
830
- currentTxIndex ++
831
- },
832
- OnForkchoiceBroadcast : func () {
833
- // Check the transaction tracing, which is client specific
834
- expectedPrevRandao := t .CLMock .PrevRandaoHistory [t .CLMock .LatestHeader .Number .Uint64 ()+ 1 ]
835
- ctx , cancel := context .WithTimeout (t .TestContext , globals .RPCTimeout )
836
- defer cancel ()
837
- if err := helper .DebugPrevRandaoTransaction (ctx , t .Client .RPC (), t .Client .Type , txs [currentTxIndex - 1 ],
838
- & expectedPrevRandao ); err != nil {
839
- t .Fatalf ("FAIL (%s): Error during transaction tracing: %v" , t .TestName , err )
840
- }
841
- },
842
- })
843
-
844
- ctx , cancel := context .WithTimeout (t .TestContext , globals .RPCTimeout )
845
- defer cancel ()
846
- lastBlockNumber , err := t .Eth .BlockNumber (ctx )
847
- if err != nil {
848
- t .Fatalf ("FAIL (%s): Unable to get latest block number: %v" , t .TestName , err )
849
- }
850
- for i := uint64 (1 ); i <= lastBlockNumber ; i ++ {
851
- checkPrevRandaoValue (t , t .CLMock .PrevRandaoHistory [i ], i )
852
- }
853
-
854
- }
855
-
856
780
// Engine API errors
857
-
858
781
func pUint64 (v uint64 ) * uint64 {
859
782
return & v
860
783
}
@@ -1150,6 +1073,20 @@ func init() {
1150
1073
},
1151
1074
)
1152
1075
1076
+ // PrevRandao opcode tests
1077
+ Tests = append (Tests ,
1078
+ PrevRandaoTransactionTest {
1079
+ BaseSpec : test.BaseSpec {
1080
+ TestTransactionType : helper .LegacyTxOnly ,
1081
+ },
1082
+ },
1083
+ PrevRandaoTransactionTest {
1084
+ BaseSpec : test.BaseSpec {
1085
+ TestTransactionType : helper .DynamicFeeTxOnly ,
1086
+ },
1087
+ },
1088
+ )
1089
+
1153
1090
// Fork ID Tests
1154
1091
Tests = append (Tests ,
1155
1092
ForkIDSpec {
0 commit comments