Skip to content

test(evm): cover delegate call storage regression#13010

Merged
ZenGround0 merged 4 commits intomasterfrom
test/evm-mint-test
Apr 22, 2025
Merged

test(evm): cover delegate call storage regression#13010
ZenGround0 merged 4 commits intomasterfrom
test/evm-mint-test

Conversation

@ZenGround0
Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes

Test for the delegatecall storage regression we caught in nv25 release

Additional Info

This is closely based on builtin actors test: https://github.com/filecoin-project/builtin-actors/pull/1667/files#diff-05c40c02b11471dd4bb78bdd48798ff3c9f8d617e0647dc899d02eaa0834b1f6R717

Checklist

Before you mark the PR ready for review, please make sure that:

@github-project-automation github-project-automation Bot moved this to 📌 Triage in FilOz Apr 4, 2025
@github-project-automation github-project-automation Bot moved this from 📌 Triage to ✔️ Approved by reviewer in FilOz Apr 4, 2025
@rvagg
Copy link
Copy Markdown
Member

rvagg commented Apr 5, 2025

I applied this diff to the test:

diff --git a/itests/eth_proxy_mint_test.go b/itests/eth_proxy_mint_test.go
index 9ca2f6a6b..1fbe4b49d 100644
--- a/itests/eth_proxy_mint_test.go
+++ b/itests/eth_proxy_mint_test.go
@@ -11,9 +11,13 @@ import (
 
        "github.com/stretchr/testify/require"
 
+       "github.com/filecoin-project/go-state-types/abi"
        "github.com/filecoin-project/go-state-types/big"
+       "github.com/filecoin-project/go-state-types/network"
 
        "github.com/filecoin-project/lotus/build/buildconstants"
+       "github.com/filecoin-project/lotus/chain/consensus/filcns"
+       "github.com/filecoin-project/lotus/chain/stmgr"
        "github.com/filecoin-project/lotus/chain/types"
        "github.com/filecoin-project/lotus/chain/types/ethtypes"
        "github.com/filecoin-project/lotus/itests/kit"
@@ -29,16 +33,47 @@ import (
 // We're using these to reproduce https://github.com/recallnet/contracts/issues/98
 func TestMintContract(t *testing.T) {
        blockTime := 100 * time.Millisecond
-       client, _, ens := kit.EnsembleMinimal(
-               t,
+
+       kit.QuietMiningLogs()
+
+       var (
+               nv25Epoch    abi.ChainEpoch = 100
+               nv26Epoch    abi.ChainEpoch = nv25Epoch + 100
+               teepFixEpoch abi.ChainEpoch = nv26Epoch + 100
+       )
+       const networkName = "testing-fake-proofs"
+       buildconstants.UpgradeTockFixHeight = teepFixEpoch // needed to be set for migration to run
+
+       client, _, ens := kit.EnsembleMinimal(t,
                kit.MockProofs(),
-               kit.ThroughRPC())
+               kit.ThroughRPC(),
+               kit.NetworkName(networkName),
+               kit.UpgradeSchedule(stmgr.Upgrade{
+                       Network: network.Version24,
+                       Height:  -1,
+               }, stmgr.Upgrade{
+                       Height:    nv25Epoch,
+                       Network:   network.Version25,
+                       Migration: filcns.UpgradeActorsV16,
+                       Expensive: true,
+               }, stmgr.Upgrade{
+                       Height:    nv26Epoch,
+                       Network:   network.Version26,
+                       Migration: nil,
+               }, stmgr.Upgrade{
+                       Height:    teepFixEpoch,
+                       Network:   network.Version26,
+                       Migration: filcns.UpgradeActorsV16Fix,
+               },
+               ))
 
        ens.InterconnectAll().BeginMining(blockTime)
 
        ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
        defer cancel()
 
+       client.WaitTillChain(ctx, kit.HeightAtLeast(teepFixEpoch+5))
+
        // Read implementation contract bytecode
        impContractHex, err := os.ReadFile("./contracts/MintImpl.hex")
        require.NoError(t, err)

I then changes the WaitTillChain line:

  1. With no wait: PASS
  2. With nv25Epoch+5: FAIL
  3. With nv26Epoch+5: FAIL
  4. With teepFixEpoch+5: PASS

The failures were the same, below:

    eth_proxy_mint_test.go:199: 
                Error Trace:    /home/rvagg/go/src/github.com/filecoin-project/lotus/itests/eth_proxy_mint_test.go:199
                Error:          Received unexpected error:
                                message execution failed (exit=[33], revert reason=[message failed with backtrace:
                                00: f01004 (method 3844450837) -- contract reverted at 86 (33)
                                01: f01004 (method 6) -- contract reverted at 7570 (33)
                                 (RetCode=33)], vm error=[0xe2517d3f000000000000000000000000da07edcce6e37a3ee921ea3ea36932a56b72db6c9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6])

Which I think means we can both reproduce the problem and confirm that the calibnet fix should address it and that 16.0.1 on mainnet will be fine. 👌

@rvagg
Copy link
Copy Markdown
Member

rvagg commented Apr 14, 2025

unrelated flaky itest noted here #13005

@BigLep
Copy link
Copy Markdown
Member

BigLep commented Apr 22, 2025

@ZenGround0 : are you good to merge?

@ZenGround0
Copy link
Copy Markdown
Contributor Author

Yes, I just kept forgetting to check / rerun CI after hitting flaky tests. Let's see if everything works this time 🤞

@ZenGround0 ZenGround0 merged commit 1a6c93f into master Apr 22, 2025
92 checks passed
@ZenGround0 ZenGround0 deleted the test/evm-mint-test branch April 22, 2025 06:18
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants