Skip to content

Commit c32bc79

Browse files
committed
DUPN and SWAPN back in Cancun
1 parent 69120d3 commit c32bc79

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

lib/instructions/instruction_metrics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ static struct evmc_instruction_metrics shanghai_metrics[256] = {
472472
/* = 0xaf */ {UNDEFINED, 0, 0},
473473
/* = 0xb0 */ {UNDEFINED, 0, 0},
474474
/* = 0xb1 */ {UNDEFINED, 0, 0},
475-
/* DUPN = 0xb2 */ {VERYLOW, 0, 1},
476-
/* SWAPN = 0xb3 */ {VERYLOW, 0, 0},
475+
/* = 0xb2 */ {UNDEFINED, 0, 0},
476+
/* = 0xb3 */ {UNDEFINED, 0, 0},
477477
/* = 0xb4 */ {UNDEFINED, 0, 0},
478478
/* = 0xb5 */ {UNDEFINED, 0, 0},
479479
/* = 0xb6 */ {UNDEFINED, 0, 0},

lib/instructions/instruction_names.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ static const char* shanghai_names[256] = {
442442
/* 0xaf */ NULL,
443443
/* 0xb0 */ NULL,
444444
/* 0xb1 */ NULL,
445-
/* 0xb2 */ "DUPN",
446-
/* 0xb3 */ "SWAPN",
445+
/* 0xb2 */ NULL,
446+
/* 0xb3 */ NULL,
447447
/* 0xb4 */ NULL,
448448
/* 0xb5 */ NULL,
449449
/* 0xb6 */ NULL,

test/unittests/instructions_test.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,6 @@ TEST(instructions, shanghai_hard_fork)
382382
{
383383
if (op == OP_PUSH0)
384384
continue;
385-
if (op == OP_DUPN)
386-
continue;
387-
if (op == OP_SWAPN)
388-
continue;
389385
EXPECT_EQ(s[op], p[op]) << op;
390386
EXPECT_STREQ(sn[op], pn[op]) << op;
391387
}
@@ -397,20 +393,4 @@ TEST(instructions, shanghai_hard_fork)
397393
EXPECT_EQ(p[OP_PUSH0].gas_cost, 0);
398394
EXPECT_EQ(sn[OP_PUSH0], std::string{"PUSH0"});
399395
EXPECT_TRUE(pn[OP_PUSH0] == nullptr);
400-
401-
// EIP-663: DUPN instruction
402-
EXPECT_EQ(s[OP_DUPN].gas_cost, 3);
403-
EXPECT_EQ(s[OP_DUPN].stack_height_required, 0);
404-
EXPECT_EQ(s[OP_DUPN].stack_height_change, 1);
405-
EXPECT_EQ(p[OP_DUPN].gas_cost, 0);
406-
EXPECT_EQ(sn[OP_DUPN], std::string{"DUPN"});
407-
EXPECT_TRUE(pn[OP_DUPN] == nullptr);
408-
409-
// EIP-663: SWAPN instruction
410-
EXPECT_EQ(s[OP_SWAPN].gas_cost, 3);
411-
EXPECT_EQ(s[OP_SWAPN].stack_height_required, 0);
412-
EXPECT_EQ(s[OP_SWAPN].stack_height_change, 0);
413-
EXPECT_EQ(p[OP_SWAPN].gas_cost, 0);
414-
EXPECT_EQ(sn[OP_SWAPN], std::string{"SWAPN"});
415-
EXPECT_TRUE(pn[OP_SWAPN] == nullptr);
416396
}

0 commit comments

Comments
 (0)