From 7334d0a30582a95e75762e2bd2be343cc9205a07 Mon Sep 17 00:00:00 2001 From: Michael Benfield Date: Wed, 27 Mar 2024 17:44:25 -0700 Subject: [PATCH] revert on selfdestruct --- contracts | 2 +- go-ethereum | 2 +- system_tests/program_test.go | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/contracts b/contracts index aeaae5d1c..61add6092 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit aeaae5d1cf934473ff630985cae3b076093b1587 +Subproject commit 61add609219f76b575e255f2be33524cadb0d071 diff --git a/go-ethereum b/go-ethereum index 8f86e725d..846839164 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 8f86e725d972a204fb91f40bf74b93b298b8689d +Subproject commit 8468391640657b3eb9ed791d4b1c3ff3b6577a8e diff --git a/system_tests/program_test.go b/system_tests/program_test.go index 8dd8384b2..5f26699bb 100644 --- a/system_tests/program_test.go +++ b/system_tests/program_test.go @@ -39,6 +39,38 @@ import ( var oneEth = arbmath.UintToBig(1e18) +func TestSelfDestruct(t *testing.T) { + t.Parallel() + + builder, auth, cleanup := setupProgramTest(t, true) + ctx := builder.ctx + l2info := builder.L2Info + l2client := builder.L2.Client + defer cleanup() + + ensure := func(tx *types.Transaction, err error) *types.Receipt { + t.Helper() + Require(t, err) + receipt, err := EnsureTxSucceeded(ctx, l2client, tx) + Require(t, err) + return receipt + } + pack := func(data []byte, err error) []byte { + Require(t, err) + return data + } + + mockAddr, tx, _, err := mocksgen.DeployProgramTest(&auth, l2client) + ensure(tx, err) + multiAddr := deployWasm(t, ctx, auth, l2client, rustFile("multicall")) + callSelfDestruct, _ := util.NewCallParser(mocksgen.ProgramTestABI, "callSelfDestruct") + + delegate := argsForMulticall(vm.DELEGATECALL, mockAddr, nil, pack(callSelfDestruct(multiAddr))) + tx = l2info.PrepareTxTo("Owner", &multiAddr, 1e9, nil, delegate) + Require(t, l2client.SendTransaction(ctx, tx)) + EnsureTxFailed(t, ctx, l2client, tx) +} + func TestProgramKeccak(t *testing.T) { t.Parallel() keccakTest(t, true)