Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 0 additions & 8 deletions .semgrep/rules/sol-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ rules:
paths:
exclude:
- packages/contracts-bedrock/src/L1/OPContractsManager.sol
- packages/contracts-bedrock/src/L1/OPContractsManagerInterop.sol
- packages/contracts-bedrock/src/legacy/L1ChugSplashProxy.sol

- id: sol-style-enforce-require-msg
Expand Down Expand Up @@ -241,10 +240,6 @@ rules:
_disableInitializers();
...
}
paths:
exclude:
- packages/contracts-bedrock/src/L1/SystemConfigInterop.sol
- packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol

- id: sol-safety-proper-initializer
languages: [solidity]
Expand Down Expand Up @@ -273,9 +268,6 @@ rules:
function initialize(...) public reinitializer(...) {
...
}
paths:
exclude:
- packages/contracts-bedrock/src/L1/SystemConfigInterop.sol

- id: sol-safety-proper-upgrade-function
languages: [solidity]
Expand Down
18 changes: 0 additions & 18 deletions op-deployer/pkg/deployer/integration_test/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,24 +401,6 @@ func TestProofParamOverrides(t *testing.T) {
}
}

func TestInteropDeployment(t *testing.T) {
op_e2e.InitParallel(t)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

opts, intent, st := setupGenesisChain(t, defaultL1ChainID)
intent.UseInterop = true

require.NoError(t, deployer.ApplyPipeline(ctx, opts))

chainState := st.Chains[0]
depManagerSlot := common.HexToHash("0x1708e077affb93e89be2665fb0fb72581be66f84dc00d25fed755ae911905b1c")
checkImmutable(t, st.L1StateDump.Data.Accounts, st.ImplementationsDeployment.SystemConfigImplAddress, depManagerSlot)
proxyAdminOwnerHash := common.BytesToHash(intent.Chains[0].Roles.SystemConfigOwner.Bytes())
checkStorageSlot(t, st.L1StateDump.Data.Accounts, chainState.SystemConfigProxyAddress, depManagerSlot, proxyAdminOwnerHash)
}

func TestAltDADeployment(t *testing.T) {
op_e2e.InitParallel(t)

Expand Down
8 changes: 1 addition & 7 deletions op-deployer/pkg/deployer/opcm/implementations.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,19 @@ func DeployImplementations(
defer cleanupOutput()

implContract := "DeployImplementations"
if input.UseInterop {
implContract = "DeployImplementationsInterop"
}
deployScript, cleanupDeploy, err := script.WithScript[DeployImplementationsScript](host, "DeployImplementations.s.sol", implContract)
if err != nil {
return output, fmt.Errorf("failed to load %s script: %w", implContract, err)
}
defer cleanupDeploy()

opcmContract := "OPContractsManager"
if err := host.RememberOnLabel("OPContractsManager", "OPContractsManager.sol", opcmContract); err != nil {
if err := host.RememberOnLabel("OPContractsManager", opcmContract+".sol", opcmContract); err != nil {
return output, fmt.Errorf("failed to link OPContractsManager label: %w", err)
}

// So we can see in detail where the SystemConfig interop initializer fails
sysConfig := "SystemConfig"
if input.UseInterop {
sysConfig = "SystemConfigInterop"
}
if err := host.RememberOnLabel("SystemConfigImpl", sysConfig+".sol", sysConfig); err != nil {
return output, fmt.Errorf("failed to link SystemConfig label: %w", err)
}
Expand Down
21 changes: 0 additions & 21 deletions op-deployer/pkg/deployer/opcm/manage_dependencies.go

This file was deleted.

33 changes: 15 additions & 18 deletions op-e2e/interop/interop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,17 @@ func TestInterop_EmitLogs(t *testing.T) {
ids := s2.L2IDs()
chainA := ids[0]
chainB := ids[1]
EmitterA := s2.DeployEmitterContract(chainA, "Alice")
EmitterB := s2.DeployEmitterContract(chainB, "Alice")

// Deploy emitter to chain A
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
EmitterA := s2.DeployEmitterContract(ctx, chainA, "Alice")

// Deploy emitter to chain B
ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
EmitterB := s2.DeployEmitterContract(ctx, chainB, "Alice")

payload1 := "SUPER JACKPOT!"
numEmits := 10
// emit logs on both chains in parallel
Expand Down Expand Up @@ -258,25 +267,13 @@ func TestInteropBlockBuilding(t *testing.T) {
ids := s2.L2IDs()
chainA := ids[0]
chainB := ids[1]
// We will initiate on chain A, and execute on chain B
s2.DeployEmitterContract(chainA, "Alice")

// Add chain A as dependency to chain B,
// such that we can execute a message on B that was initiated on A.
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
depRec := s2.AddDependency(ctx, chainB, s2.ChainID(chainA))
cancel()
t.Logf("Dependency set in L1 block %d", depRec.BlockNumber)

rollupClA := s2.L2RollupClient(chainA, "sequencer")

// Now wait for the dependency to be visible in the L2 (receipt needs to be picked up)
require.Eventually(t, func() bool {
status, err := rollupClA.SyncStatus(context.Background())
require.NoError(t, err)
return status.CrossUnsafeL2.L1Origin.Number >= depRec.BlockNumber.Uint64()
}, time.Second*30, time.Second, "wait for L1 origin to match dependency L1 block")
t.Log("Dependency information has been processed in L2 block")
// We will initiate on chain A, and execute on chain B
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
s2.DeployEmitterContract(ctx, chainA, "Alice")

// emit log on chain A
ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second)
Expand Down
37 changes: 5 additions & 32 deletions op-e2e/interop/supersystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/interop/contracts/bindings/emit"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/interop/contracts/bindings/inbox"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/interop/contracts/bindings/systemconfig"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-e2e/system/helpers"
l2os "github.com/ethereum-optimism/optimism/op-proposer/proposer"
"github.com/ethereum-optimism/optimism/op-service/client"
Expand Down Expand Up @@ -94,8 +93,7 @@ type SuperSystem interface {
L2OperatorKey(network string, role devkeys.ChainOperatorRole) ecdsa.PrivateKey
Address(network string, username string) common.Address
Contract(network string, contractName string) interface{}
DeployEmitterContract(network string, username string) common.Address
AddDependency(ctx context.Context, network string, dep *big.Int) *types.Receipt
DeployEmitterContract(ctx context.Context, network string, username string) common.Address
ValidateMessage(
ctx context.Context,
id string,
Expand Down Expand Up @@ -539,37 +537,10 @@ func (s *interopE2ESystem) ValidateMessage(
return bind.WaitMined(ctx, s.L2GethClient(id, "sequencer"), tx) // use the sequencer client to wait for the tx
}

func (s *interopE2ESystem) AddDependency(ctx context.Context, id string, dep *big.Int) *types.Receipt {
// There is a note in OPContractsManagerInterop that the proxy-admin is used for now,
// even though it should be a separate dependency-set-manager address.
secret, err := s.hdWallet.Secret(devkeys.ChainOperatorKey{
ChainID: s.l2s[id].chainID,
Role: devkeys.SystemConfigOwner,
})
require.NoError(s.t, err)

auth, err := bind.NewKeyedTransactorWithChainID(secret, s.worldOutput.L1.Genesis.Config.ChainID)
require.NoError(s.t, err)

balance, err := s.l1GethClient.BalanceAt(ctx, crypto.PubkeyToAddress(secret.PublicKey), nil)
require.NoError(s.t, err)
require.False(s.t, balance.Sign() == 0, "system config owner needs a balance")

auth.GasLimit = uint64(3000000)
auth.GasPrice = big.NewInt(20000000000)

contract := s.Contract(id, "systemconfig").(*systemconfig.Systemconfig)
tx, err := contract.SystemconfigTransactor.AddDependency(auth, dep)
require.NoError(s.t, err)

receipt, err := wait.ForReceiptOK(ctx, s.L1GethClient(), tx.Hash())
require.NoError(s.t, err)
return receipt
}

// DeployEmitterContract deploys the Emitter contract on the L2
// it uses the sequencer node to deploy the contract
func (s *interopE2ESystem) DeployEmitterContract(
ctx context.Context,
id string,
sender string,
) common.Address {
Expand All @@ -578,7 +549,9 @@ func (s *interopE2ESystem) DeployEmitterContract(
require.NoError(s.t, err)
auth.GasLimit = uint64(3000000)
auth.GasPrice = big.NewInt(20000000000)
address, _, _, err := emit.DeployEmit(auth, s.L2GethClient(id, "sequencer"))
address, tx, _, err := emit.DeployEmit(auth, s.L2GethClient(id, "sequencer"))
require.NoError(s.t, err)
_, err = bind.WaitMined(ctx, s.L2GethClient(id, "sequencer"), tx)
require.NoError(s.t, err)
contract, err := emit.NewEmit(address, s.L2GethClient(id, "sequencer"))
require.NoError(s.t, err)
Expand Down
6 changes: 1 addition & 5 deletions packages/contracts-bedrock/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ compilation_restrictions = [
{ paths = "src/dispute/SuperFaultDisputeGame.sol", optimizer_runs = 5000 },
{ paths = "src/dispute/SuperPermissionedDisputeGame.sol", optimizer_runs = 5000 },
{ paths = "src/L1/OPContractsManager.sol", optimizer_runs = 5000 },
{ paths = "src/L1/OPContractsManagerInterop.sol", optimizer_runs = 5000 },
{ paths = "src/L1/StandardValidator.sol", optimizer_runs = 5000 },
{ paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 5000 },
{ paths = "src/L1/OptimismPortalInterop.sol", optimizer_runs = 5000 },
{ paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 5000 }
]

extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
Expand Down Expand Up @@ -145,10 +143,8 @@ compilation_restrictions = [
{ paths = "src/dispute/SuperFaultDisputeGame.sol", optimizer_runs = 0 },
{ paths = "src/dispute/SuperPermissionedDisputeGame.sol", optimizer_runs = 0 },
{ paths = "src/L1/OPContractsManager.sol", optimizer_runs = 0 },
{ paths = "src/L1/OPContractsManagerInterop.sol", optimizer_runs = 0 },
{ paths = "src/L1/StandardValidator.sol", optimizer_runs = 0 },
{ paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 0 },
{ paths = "src/L1/OptimismPortalInterop.sol", optimizer_runs = 0 },
]

################################################################
Expand Down
135 changes: 0 additions & 135 deletions packages/contracts-bedrock/interfaces/L1/IOptimismPortalInterop.sol

This file was deleted.

Loading