@@ -38,6 +38,10 @@ func pUint64(v uint64) *uint64 {
3838 return & v
3939}
4040
41+ func pInt (v int ) * int {
42+ return & v
43+ }
44+
4145// Execution specification reference:
4246// https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md
4347
@@ -506,6 +510,52 @@ var Tests = []test.SpecInterface{
506510 },
507511 },
508512 },
513+ // NewPayload Version Negative Tests
514+ & BlobsBaseSpec {
515+
516+ Spec : test.Spec {
517+ Name : "NewPayloadV2 After Cancun" ,
518+ About : `
519+ Test sending NewPayloadV2 after cancun fork, which
520+ should result in error.
521+ ` ,
522+ },
523+
524+ // We fork on genesis
525+ CancunForkHeight : 0 ,
526+
527+ TestSequence : TestSequence {
528+ // Send multiple blob transactions with the same nonce.
529+ NewPayloads {
530+ ExpectedIncludedBlobCount : 0 ,
531+ Version : 2 ,
532+ ExpectedError : pInt (- 38005 ),
533+ },
534+ },
535+ },
536+ & BlobsBaseSpec {
537+
538+ Spec : test.Spec {
539+ Name : "NewPayloadV3 Before Cancun" ,
540+ About : `
541+ Test sending NewPayloadV3 before cancun fork, which
542+ should result in error.
543+ ` ,
544+ },
545+
546+ // We fork on genesis
547+ CancunForkHeight : 2 ,
548+
549+ TestSequence : TestSequence {
550+ // Send multiple blob transactions with the same nonce.
551+ NewPayloads {
552+ ExpectedIncludedBlobCount : 0 ,
553+ Version : 3 ,
554+ ExpectedError : pInt (- 38005 ),
555+ },
556+ },
557+ },
558+
509559 // Test versioned hashes in Engine API NewPayloadV3
510560 & BlobsBaseSpec {
511561
@@ -527,6 +577,7 @@ var Tests = []test.SpecInterface{
527577 VersionedHashes : & VersionedHashes {
528578 Blobs : helper .GetBlobList (0 , TARGET_BLOBS_PER_BLOCK - 1 ),
529579 },
580+ ExpectedStatus : test .Invalid ,
530581 },
531582 },
532583 },
@@ -552,6 +603,7 @@ var Tests = []test.SpecInterface{
552603 VersionedHashes : & VersionedHashes {
553604 Blobs : helper .GetBlobList (0 , TARGET_BLOBS_PER_BLOCK + 1 ),
554605 },
606+ ExpectedStatus : test .Invalid ,
555607 },
556608 },
557609 },
@@ -575,6 +627,7 @@ var Tests = []test.SpecInterface{
575627 VersionedHashes : & VersionedHashes {
576628 Blobs : helper .GetBlobListByIndex (helper .BlobID (TARGET_BLOBS_PER_BLOCK - 1 ), 0 ),
577629 },
630+ ExpectedStatus : test .Invalid ,
578631 },
579632 },
580633 },
@@ -598,6 +651,7 @@ var Tests = []test.SpecInterface{
598651 VersionedHashes : & VersionedHashes {
599652 Blobs : append (helper .GetBlobList (0 , TARGET_BLOBS_PER_BLOCK ), helper .BlobID (TARGET_BLOBS_PER_BLOCK - 1 )),
600653 },
654+ ExpectedStatus : test .Invalid ,
601655 },
602656 },
603657 },
@@ -621,6 +675,7 @@ var Tests = []test.SpecInterface{
621675 VersionedHashes : & VersionedHashes {
622676 Blobs : append (helper .GetBlobList (0 , TARGET_BLOBS_PER_BLOCK - 1 ), helper .BlobID (TARGET_BLOBS_PER_BLOCK )),
623677 },
678+ ExpectedStatus : test .Invalid ,
624679 },
625680 },
626681 },
@@ -644,6 +699,7 @@ var Tests = []test.SpecInterface{
644699 Blobs : helper .GetBlobList (0 , TARGET_BLOBS_PER_BLOCK ),
645700 HashVersions : []byte {BLOB_COMMITMENT_VERSION_KZG , BLOB_COMMITMENT_VERSION_KZG + 1 },
646701 },
702+ ExpectedStatus : test .Invalid ,
647703 },
648704 },
649705 },
@@ -667,6 +723,7 @@ var Tests = []test.SpecInterface{
667723 VersionedHashes : & VersionedHashes {
668724 Blobs : nil ,
669725 },
726+ ExpectedStatus : test .Invalid ,
670727 },
671728 },
672729 },
@@ -690,6 +747,7 @@ var Tests = []test.SpecInterface{
690747 VersionedHashes : & VersionedHashes {
691748 Blobs : []helper.BlobID {},
692749 },
750+ ExpectedStatus : test .Invalid ,
693751 },
694752 },
695753 },
@@ -709,6 +767,7 @@ var Tests = []test.SpecInterface{
709767 VersionedHashes : & VersionedHashes {
710768 Blobs : []helper.BlobID {0 },
711769 },
770+ ExpectedStatus : test .Invalid ,
712771 },
713772 },
714773 },
@@ -719,9 +778,9 @@ var Tests = []test.SpecInterface{
719778 Spec : test.Spec {
720779 Name : "NewPayloadV3 Versioned Hashes, Missing Hash (Syncing)" ,
721780 About : `
722- Tests VersionedHashes in Engine API NewPayloadV3 where the array
723- is missing one of the hashes.
724- ` ,
781+ Tests VersionedHashes in Engine API NewPayloadV3 where the array
782+ is missing one of the hashes.
783+ ` ,
725784 },
726785 TestSequence : TestSequence {
727786 NewPayloads {}, // Send new payload so the parent is unknown to the secondary client
0 commit comments