Skip to content

Commit

Permalink
op-node: fix ecotone upgrade test (#10092)
Browse files Browse the repository at this point in the history
* op-node: fix ecotone upgrade test

Previously the upgrade transactions test made an assertion against
the bytecode that is in the bindings. This needs to be modified
because the upgrade txs cannot ever change as they are part of
consensus. Any modification to the bindings means that the assertion
will fail. We should test against the expected value directly
instead of going through the binding that has no guarantee
to be on a particular version and will change over time.

* op-node: fix test
  • Loading branch information
tynes authored Apr 10, 2024
1 parent e3e21bd commit 097ca87
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions op-node/rollup/derive/ecotone_upgrade_transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"

"github.com/ethereum-optimism/optimism/op-bindings/bindings"
)

func TestSourcesMatchSpec(t *testing.T) {
Expand Down Expand Up @@ -71,14 +69,14 @@ func TestEcotoneNetworkTransactions(t *testing.T) {
require.Equal(t, deployL1BlockSource.SourceHash(), deployL1Block.SourceHash())
require.Nil(t, deployL1Block.To())
require.Equal(t, uint64(375_000), deployL1Block.Gas())
require.Equal(t, bindings.L1BlockMetaData.Bin, hexutil.Bytes(deployL1Block.Data()).String())
require.Equal(t, l1BlockDeploymentBytecode, deployL1Block.Data())

deployGasPriceOracleSender, deployGasPriceOracle := toDepositTxn(t, upgradeTxns[1])
require.Equal(t, deployGasPriceOracleSender, common.HexToAddress("0x4210000000000000000000000000000000000001"))
require.Equal(t, deployGasPriceOracleSource.SourceHash(), deployGasPriceOracle.SourceHash())
require.Nil(t, deployGasPriceOracle.To())
require.Equal(t, uint64(1_000_000), deployGasPriceOracle.Gas())
require.Equal(t, bindings.GasPriceOracleMetaData.Bin, hexutil.Bytes(deployGasPriceOracle.Data()).String())
require.Equal(t, gasPriceOracleDeploymentBytecode, deployGasPriceOracle.Data())

updateL1BlockProxySender, updateL1BlockProxy := toDepositTxn(t, upgradeTxns[2])
require.Equal(t, updateL1BlockProxySender, common.Address{})
Expand Down

0 comments on commit 097ca87

Please sign in to comment.