Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ec1f65a
feat: update IL1Block and info
leruaa Feb 3, 2025
7ee2f7b
feat: update SystemConfig
leruaa Feb 3, 2025
4661c21
feat: add operator fee vault
leruaa Feb 3, 2025
7bf29ea
feat: handle transactions at Istmus activation
leruaa Feb 3, 2025
c17d6b8
feat: update GasPriceOracle
leruaa Feb 3, 2025
92c569d
feat: update deployment
leruaa Feb 3, 2025
e04c261
chore: update snapshots and semvers
leruaa Feb 3, 2025
39792e0
fix: GasPriceOracle nits
leruaa Feb 3, 2025
f7da141
fix: operator fee scalars ordering
leruaa Feb 3, 2025
199fa59
fix: handle feedbacks
leruaa Feb 4, 2025
f1bcf76
feat: remove operator fee vault constructor arguments
leruaa Feb 4, 2025
df39131
chore: update e2e TestFees to handle operator fee
leruaa Feb 4, 2025
4c2f410
chore: update snapshots
leruaa Feb 4, 2025
5534e8c
fix: remove operator fee vault parameters on deployment
leruaa Feb 4, 2025
8c19988
feat: handle overflow for operator fee in GasPriceOracle
leruaa Feb 5, 2025
76bd899
chore: fee test
leruaa Feb 5, 2025
4d09580
chore: add e2e test to ensure operator fee doesn't ends up minting or…
leruaa Feb 7, 2025
a56fa9b
fix: tests
leruaa Feb 11, 2025
83cf6a2
chore: use operator fee OP Geth branch for CI
leruaa Feb 11, 2025
f1c4965
fix: tests
leruaa Feb 11, 2025
96f21db
fix(op-node): ordering of network upgrade txs
refcell Feb 12, 2025
766a1dd
fix: semver lock
refcell Feb 12, 2025
0708f50
fix: sys config interop
refcell Feb 12, 2025
5f92c81
fix: semver lock
refcell Feb 12, 2025
a538cd6
fix: arithmetic return args
refcell Feb 12, 2025
5ea33cd
fix: semver lock
refcell Feb 12, 2025
5c0ef79
update system config interop
refcell Feb 12, 2025
65fc270
fix: sys config interop semver lock
refcell Feb 12, 2025
ff654d9
fix: trailing newline
refcell Feb 12, 2025
770f4f9
chore: update tag
leruaa Feb 12, 2025
466ba16
fix: point to Isthmus by default
leruaa Feb 14, 2025
d949d2c
fix: TestParseL1InfoDepositTxData
leruaa Feb 14, 2025
50087c0
Update test to catch Alice balance underflow
teddyknox Feb 14, 2025
033674b
fix: Test_Operator_Fee_Constistency
leruaa Feb 14, 2025
48d238b
chore: update tag
leruaa Feb 26, 2025
73bbfb7
fix: operator fee are nil in receipts if both are 0
leruaa Feb 27, 2025
bebef00
chore: set the correct op-geth tag
leruaa Feb 28, 2025
600b80a
fix: handle sebastianst feedbacks
leruaa Mar 3, 2025
a08951c
fix: another round of feedbacks
leruaa Mar 4, 2025
ea03200
nit: useless cast
leruaa Mar 4, 2025
a6745a1
chore: remove beta in contract versions
leruaa Mar 5, 2025
640be76
chore: more comments on contract versions
leruaa Mar 5, 2025
dbb6c36
fix semgrep
mslipper Mar 4, 2025
77a53b9
preinstall compilers
mslipper Mar 5, 2025
d1d8b2a
schema
mslipper Mar 5, 2025
205c5f1
indent
mslipper Mar 5, 2025
129523f
add yes pipe
mslipper Mar 5, 2025
9bcb3a6
ignore yes code
mslipper Mar 5, 2025
27e1c59
try echo
mslipper Mar 5, 2025
4486a1c
try wiping out the svm dir
mslipper Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ commands:
install-contracts-dependencies:
description: "Install the dependencies for the smart contracts"
steps:
- run:
name: Install SVM compilers
command: |
# Have to wipe out the SVM directory to avoid issues with the SVM version
rm -rf ~/.svm/*
svm install 0.8.15
svm install 0.8.19
svm install 0.8.25
svm install 0.8.28
- run:
name: Install dependencies
command: |
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101500.2-rc.1
replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101500.2-rc.2

//replace github.com/ethereum/go-ethereum => ../op-geth

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/u
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101500.2-rc.1 h1:CCQtyKKobjMbK9jYd676YbH6Xcvntdn6jIOxFTCb5B8=
github.com/ethereum-optimism/op-geth v1.101500.2-rc.1/go.mod h1:OMpyVMMy5zpAAHlR5s/aGbXRk+7cIKczUEIJj54APbY=
github.com/ethereum-optimism/op-geth v1.101500.2-rc.2 h1:sUPXJ07X4Ud0QCtVWFeuhWe0y9WP5QXEduo8ZRVOeXs=
github.com/ethereum-optimism/op-geth v1.101500.2-rc.2/go.mod h1:OMpyVMMy5zpAAHlR5s/aGbXRk+7cIKczUEIJj54APbY=
github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250205201532-8ff62ada16e1 h1:OqRYDcjiOx5QCLn5krpd3BK1CW+VfSZx7YIa6zY9ePE=
github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250205201532-8ff62ada16e1/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
Expand Down
21 changes: 17 additions & 4 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ type GasPriceOracleDeployConfig struct {
GasPriceOracleBaseFeeScalar uint32 `json:"gasPriceOracleBaseFeeScalar" evm:"basefeeScalar"`
// GasPriceOracleBlobBaseFeeScalar represents the value of the blob base fee scalar used for fee calculations.
GasPriceOracleBlobBaseFeeScalar uint32 `json:"gasPriceOracleBlobBaseFeeScalar" evm:"blobbasefeeScalar"`
// GasPriceOracleOperatorFeeScalar represents the value of the operator fee scalar used for fee calculations.
GasPriceOracleOperatorFeeScalar uint32 `json:"gasPriceOracleOperatorFeeScalar" evm:"operatorfeeScalar"`
// GasPriceOracleOperatorFeeConstant represents the value of the operator fee constant used for fee calculations.
GasPriceOracleOperatorFeeConstant uint64 `json:"gasPriceOracleOperatorFeeConstant" evm:"operatorfeeConstant"`
}

var _ ConfigChecker = (*GasPriceOracleDeployConfig)(nil)
Expand All @@ -259,6 +263,14 @@ func (d *GasPriceOracleDeployConfig) FeeScalar() [32]byte {
})
}

// OperatorFeeParams returns the raw serialized operator fee params.
func (d *GasPriceOracleDeployConfig) OperatorFeeParams() [32]byte {
return eth.EncodeOperatorFeeParams(eth.OperatorFeeParams{
Scalar: d.GasPriceOracleOperatorFeeScalar,
Constant: d.GasPriceOracleOperatorFeeConstant,
})
}

// GasTokenDeployConfig configures the optional custom gas token functionality.
type GasTokenDeployConfig struct {
// UseCustomGasToken is a flag to indicate that a custom gas token should be used
Expand Down Expand Up @@ -1036,10 +1048,11 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Header, l2GenesisBlockHa
// Overhead value is considered a noop.
func (d *DeployConfig) GenesisSystemConfig() eth.SystemConfig {
return eth.SystemConfig{
BatcherAddr: d.BatchSenderAddress,
Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(d.GasPriceOracleOverhead))),
Scalar: d.FeeScalar(),
GasLimit: uint64(d.L2GenesisBlockGasLimit),
BatcherAddr: d.BatchSenderAddress,
Overhead: eth.Bytes32(common.BigToHash(new(big.Int).SetUint64(d.GasPriceOracleOverhead))),
Scalar: d.FeeScalar(),
GasLimit: uint64(d.L2GenesisBlockGasLimit),
OperatorFeeParams: d.OperatorFeeParams(),
}
}

Expand Down
2 changes: 2 additions & 0 deletions op-chain-ops/genesis/testdata/test-deploy-config-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"protocolVersionsProxy": "0x0000000000000000000000000000000000000000",
"gasPriceOracleBaseFeeScalar": 0,
"gasPriceOracleBlobBaseFeeScalar": 0,
"gasPriceOracleOperatorFeeScalar": 0,
"gasPriceOracleOperatorFeeConstant": 0,
"gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000,
"enableGovernance": true,
Expand Down
3 changes: 3 additions & 0 deletions op-deployer/pkg/deployer/opcm/opchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ type DeployOPChainInput struct {
DisputeClockExtension uint64
DisputeMaxClockDuration uint64
AllowCustomDisputeParameters bool

OperatorFeeScalar uint32
OperatorFeeConstant uint64
}

func (input *DeployOPChainInput) InputSet() bool {
Expand Down
2 changes: 2 additions & 0 deletions op-deployer/pkg/deployer/pipeline/opchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common
DisputeClockExtension: proofParams.DisputeClockExtension, // 3 hours (input in seconds)
DisputeMaxClockDuration: proofParams.DisputeMaxClockDuration, // 3.5 days (input in seconds)
AllowCustomDisputeParameters: proofParams.DangerouslyAllowCustomDisputeParameters,
OperatorFeeScalar: thisIntent.OperatorFeeScalar,
OperatorFeeConstant: thisIntent.OperatorFeeConstant,
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions op-deployer/pkg/deployer/state/chain_intent.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type ChainIntent struct {
DeployOverrides map[string]any `json:"deployOverrides" toml:"deployOverrides"`
DangerousAltDAConfig genesis.AltDADeployConfig `json:"dangerousAltDAConfig,omitempty" toml:"dangerousAltDAConfig,omitempty"`
AdditionalDisputeGames []AdditionalDisputeGame `json:"dangerousAdditionalDisputeGames" toml:"dangerousAdditionalDisputeGames,omitempty"`
OperatorFeeScalar uint32 `json:"operatorFeeScalar,omitempty" toml:"operatorFeeScalar,omitempty"`
OperatorFeeConstant uint64 `json:"operatorFeeConstant,omitempty" toml:"operatorFeeConstant,omitempty"`
}

type ChainRoles struct {
Expand Down
6 changes: 4 additions & 2 deletions op-deployer/pkg/deployer/state/deploy_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ func CombineDeployConfig(intent *Intent, chainIntent *ChainIntent, state *State,
GovernanceTokenOwner: common.HexToAddress("0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAdDEad"),
},
GasPriceOracleDeployConfig: genesis.GasPriceOracleDeployConfig{
GasPriceOracleBaseFeeScalar: 1368,
GasPriceOracleBlobBaseFeeScalar: 810949,
GasPriceOracleBaseFeeScalar: 1368,
GasPriceOracleBlobBaseFeeScalar: 810949,
GasPriceOracleOperatorFeeScalar: chainIntent.OperatorFeeScalar,
GasPriceOracleOperatorFeeConstant: chainIntent.OperatorFeeConstant,
},
EIP1559DeployConfig: genesis.EIP1559DeployConfig{
EIP1559Denominator: chainIntent.Eip1559Denominator,
Expand Down
135 changes: 135 additions & 0 deletions op-e2e/actions/proofs/operator_fee_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
package proofs

import (
"math/big"
"testing"

actionsHelpers "github.com/ethereum-optimism/optimism/op-e2e/actions/helpers"
"github.com/ethereum-optimism/optimism/op-e2e/actions/proofs/helpers"
"github.com/ethereum-optimism/optimism/op-e2e/bindings"
"github.com/ethereum-optimism/optimism/op-program/client/claim"
"github.com/ethereum-optimism/optimism/op-service/predeploys"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)

func Test_Operator_Fee_Constistency(gt *testing.T) {

const testOperatorFeeScalar = uint32(20000)
const testOperatorFeeConstant = uint64(500)

runIsthmusDerivationTest := func(gt *testing.T, testCfg *helpers.TestCfg[any]) {
t := actionsHelpers.NewDefaultTesting(gt)

env := helpers.NewL2FaultProofEnv(t, testCfg, helpers.NewTestParams(), helpers.NewBatcherCfg())

balanceAt := func(a common.Address) *big.Int {
t.Helper()
bal, err := env.Engine.EthClient().BalanceAt(t.Ctx(), a, nil)
require.NoError(t, err)
return bal
}

t.Logf("L2 Genesis Time: %d, IsthmusTime: %d ", env.Sequencer.RollupCfg.Genesis.L2Time, *env.Sequencer.RollupCfg.IsthmusTime)

sysCfgContract, err := bindings.NewSystemConfig(env.Sd.RollupCfg.L1SystemConfigAddress, env.Miner.EthClient())
require.NoError(t, err)

sysCfgOwner, err := bind.NewKeyedTransactorWithChainID(env.Dp.Secrets.Deployer, env.Sd.RollupCfg.L1ChainID)
require.NoError(t, err)

// Update the operator fee parameters
_, err = sysCfgContract.SetOperatorFeeScalars(sysCfgOwner, testOperatorFeeScalar, testOperatorFeeConstant)
require.NoError(t, err)

env.Miner.ActL1StartBlock(12)(t)
env.Miner.ActL1IncludeTx(env.Dp.Addresses.Deployer)(t)
env.Miner.ActL1EndBlock(t)

// sequence L2 blocks, and submit with new batcher
env.Sequencer.ActL1HeadSignal(t)
env.Sequencer.ActBuildToL1Head(t)
env.Batcher.ActSubmitAll(t)
env.Miner.ActL1StartBlock(12)(t)
env.Miner.ActL1EndBlock(t)

aliceInitialBalance := balanceAt(env.Alice.Address())
operatorFeeVaultInitialBalance := balanceAt(predeploys.OperatorFeeVaultAddr)

require.Equal(t, operatorFeeVaultInitialBalance.Sign(), 0)

env.Sequencer.ActL2StartBlock(t)
// Send an L2 tx
env.Alice.L2.ActResetTxOpts(t)
env.Alice.L2.ActSetTxToAddr(&env.Dp.Addresses.Bob)
env.Alice.L2.ActMakeTx(t)
env.Engine.ActL2IncludeTx(env.Alice.Address())(t)
env.Sequencer.ActL2EndBlock(t)

receipt := env.Alice.L2.LastTxReceipt(t)

// Check that the operator fee was applied
require.Equal(t, testOperatorFeeScalar, uint32(*receipt.OperatorFeeScalar))
require.Equal(t, testOperatorFeeConstant, *receipt.OperatorFeeConstant)

l1FeeVaultBalance := balanceAt(predeploys.L1FeeVaultAddr)
baseFeeVaultBalance := balanceAt(predeploys.BaseFeeVaultAddr)
sequencerFeeVaultBalance := balanceAt(predeploys.SequencerFeeVaultAddr)
operatorFeeVaultFinalBalance := balanceAt(predeploys.OperatorFeeVaultAddr)
aliceFinalBalance := balanceAt(env.Alice.Address())

require.True(t, aliceFinalBalance.Cmp(aliceInitialBalance) < 0, "Alice's balance should decrease")

// Check that the operator fee sent to the vault is correct
require.Equal(t,
new(big.Int).Add(
new(big.Int).Div(
new(big.Int).Mul(
new(big.Int).SetUint64(receipt.GasUsed),
new(big.Int).SetUint64(uint64(testOperatorFeeScalar)),
),
new(big.Int).SetUint64(1e6),
),
new(big.Int).SetUint64(testOperatorFeeConstant),
),
operatorFeeVaultFinalBalance,
)

// Check that no Ether has been minted or burned
// All vault balances are 0 at the beginning of the test
finalTotalBalance := new(big.Int).Add(
aliceFinalBalance,
new(big.Int).Add(
new(big.Int).Add(l1FeeVaultBalance, sequencerFeeVaultBalance),
new(big.Int).Add(operatorFeeVaultFinalBalance, baseFeeVaultBalance),
),
)

require.Equal(t, aliceInitialBalance, finalTotalBalance)

l2SafeHead := env.Sequencer.L2Safe()

env.RunFaultProofProgram(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...)
}

matrix := helpers.NewMatrix[any]()
defer matrix.Run(gt)

matrix.AddTestCase(
"HonestClaim-OperatorFeeConstistency",
nil,
helpers.NewForkMatrix(helpers.Isthmus),
runIsthmusDerivationTest,
helpers.ExpectNoError(),
)

matrix.AddTestCase(
"JunkClaim-OperatorFeeConstistency",
nil,
helpers.NewForkMatrix(helpers.Isthmus),
runIsthmusDerivationTest,
helpers.ExpectError(claim.ErrClaimNotValid),
helpers.WithL2Claim(common.HexToHash("0xdeadbeef")),
)
}
63 changes: 57 additions & 6 deletions op-e2e/actions/upgrades/isthmus_fork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"testing"
"time"

"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-e2e/actions/helpers"
"github.com/ethereum-optimism/optimism/op-e2e/bindings"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-service/client"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/predeploys"
Expand All @@ -26,6 +28,12 @@ import (
"github.com/stretchr/testify/require"
)

var (
isthmusL1BlockCodeHash = common.HexToHash("0xe59074b8d4c08924ce463087b05485b835650652528383a32ef009fb2b6d4050")
isthmusGasPriceOracleCodeHash = common.HexToHash("0x9279e9e0535a7b63939d670e7faec536256b63d4ff353eb521a3342c51ce26e5")
isthmusOperatorFeeVaultCodeHash = common.HexToHash("0x9ee0fa5ab86f13f58fcb8f798f3a74401a8493d99d1c5b3bad19a8dff4b3194f")
)

func TestIsthmusActivationAtGenesis(gt *testing.T) {
t := helpers.NewDefaultTesting(gt)
env := helpers.SetupEnv(t, helpers.WithActiveGenesisFork(rollup.Isthmus))
Expand Down Expand Up @@ -341,6 +349,16 @@ func TestIsthmusNetworkUpgradeTransactions(gt *testing.T) {
sequencer.ActL2PipelineFull(t)
verifier.ActL2PipelineFull(t)

// Get gas price from oracle
gasPriceOracle, err := bindings.NewGasPriceOracleCaller(predeploys.GasPriceOracleAddr, ethCl)
require.NoError(t, err)

// Get current implementations addresses (by slot) for L1Block + GasPriceOracle
initialL1BlockAddress, err := ethCl.StorageAt(context.Background(), predeploys.L1BlockAddr, genesis.ImplementationSlot, nil)
require.NoError(t, err)
initialGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, nil)
require.NoError(t, err)

// Build to the isthmus block
sequencer.ActBuildL2ToIsthmus(t)

Expand All @@ -353,14 +371,47 @@ func TestIsthmusNetworkUpgradeTransactions(gt *testing.T) {

// L1Block: 1 set-L1-info + 1 deploy
// See [derive.IsthmusNetworkUpgradeTransactions]
require.Equal(t, 2, len(transactions))
require.Equal(t, 9, len(transactions))

// All transactions are successful
for i := 1; i < 9; i++ {
txn := transactions[i]
receipt, err := ethCl.TransactionReceipt(context.Background(), txn.Hash())
require.NoError(t, err)
require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status)
require.NotEmpty(t, txn.Data(), "upgrade tx must provide input data")
}

expectedL1BlockAddress := crypto.CreateAddress(derive.L1BlockIsthmusDeployerAddress, 0)

// L1 Block Proxy is updated
updatedL1BlockAddress, err := ethCl.StorageAt(context.Background(), predeploys.L1BlockAddr, genesis.ImplementationSlot, latestBlock.Number())
require.NoError(t, err)
require.Equal(t, expectedL1BlockAddress, common.BytesToAddress(updatedL1BlockAddress))
require.NotEqualf(t, initialL1BlockAddress, updatedL1BlockAddress, "Gas L1 Block address should have changed")
verifyCodeHashMatches(t, ethCl, expectedL1BlockAddress, isthmusL1BlockCodeHash)

expectedGasPriceOracleAddress := crypto.CreateAddress(derive.GasPriceOracleIsthmusDeployerAddress, 0)

// Gas Price Oracle Proxy is updated
updatedGasPriceOracleAddress, err := ethCl.StorageAt(context.Background(), predeploys.GasPriceOracleAddr, genesis.ImplementationSlot, latestBlock.Number())
require.NoError(t, err)
require.Equal(t, expectedGasPriceOracleAddress, common.BytesToAddress(updatedGasPriceOracleAddress))
require.NotEqualf(t, initialGasPriceOracleAddress, updatedGasPriceOracleAddress, "Gas Price Oracle Proxy address should have changed")
verifyCodeHashMatches(t, ethCl, expectedGasPriceOracleAddress, isthmusGasPriceOracleCodeHash)

// Check that Isthmus was activated
isIsthmus, err := gasPriceOracle.IsIsthmus(nil)
require.NoError(t, err)
require.True(t, isIsthmus)

expectedOperatorFeeVaultAddress := crypto.CreateAddress(derive.OperatorFeeVaultDeployerAddress, 0)

// Contract deployment transaction
txn := transactions[1]
receipt, err := ethCl.TransactionReceipt(context.Background(), txn.Hash())
// Operator Fee vault is updated
updatedOperatorFeeVaultAddress, err := ethCl.StorageAt(context.Background(), predeploys.OperatorFeeVaultAddr, genesis.ImplementationSlot, latestBlock.Number())
require.NoError(t, err)
require.Equal(t, types.ReceiptStatusSuccessful, receipt.Status, "block hashes deployment tx must pass")
require.NotEmpty(t, txn.Data(), "upgrade tx must provide input data")
require.Equal(t, expectedOperatorFeeVaultAddress, common.BytesToAddress(updatedOperatorFeeVaultAddress))
verifyCodeHashMatches(t, ethCl, expectedOperatorFeeVaultAddress, isthmusOperatorFeeVaultCodeHash)

// EIP-2935 contract is deployed
expectedBlockHashAddress := crypto.CreateAddress(predeploys.EIP2935ContractDeployer, 0)
Expand Down
Loading