Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4f7d40e
Changes to the inbox contract. Test TestBatchInbox_SwitchActiveBatche…
philippecamacho Nov 14, 2025
04f063e
Fix logical error in the Inbox contract.
philippecamacho Nov 14, 2025
c3764db
Fix golint errors
philippecamacho Nov 14, 2025
90942e0
Remove unneeded changes.
philippecamacho Nov 14, 2025
6b6e3e6
Fix configuration
philippecamacho Nov 14, 2025
c5ebcea
Inbox contract unit test.
philippecamacho Nov 14, 2025
b236b0f
Remove integration test for Inbox contract that was confusing.
philippecamacho Nov 14, 2025
4112ad8
Fix solidity formatting.
philippecamacho Nov 14, 2025
4156aa8
Fix configuration
philippecamacho Nov 14, 2025
5794792
Run the L1 contracts tests in CI.
philippecamacho Nov 14, 2025
98e871e
Pinpoint forge version
philippecamacho Nov 14, 2025
c5056d4
Trying to fix configuration issue for e2e tests.
philippecamacho Nov 14, 2025
2a5bf6c
Small configuration change.
philippecamacho Nov 14, 2025
7d81c15
Swapping batchers in batch inbox contract constructor.
philippecamacho Nov 14, 2025
7ffeeb3
Remove redundant concept of preApprovedBatcherKey.
philippecamacho Nov 15, 2025
02d4e1a
Document BatchInbox.sol contract.
philippecamacho Nov 15, 2025
9534004
Add a test to ensure the TEE and non TEE batchers addresses are diffe…
philippecamacho Nov 15, 2025
c69af11
Check formatting before running the tests.
philippecamacho Nov 15, 2025
a9e5263
Ensure the devnet uses two different addresses for the TEE and non TE…
philippecamacho Nov 15, 2025
1d47fe2
Improve handling of configuration variables.
philippecamacho Nov 16, 2025
0b9e438
Allow two batcher having the same address.
philippecamacho Nov 17, 2025
d3335b0
Only authenticate batcher in Inbox contract for the non TEE case.
philippecamacho Nov 17, 2025
a690d58
Change Inbox contract API: the tee batcher address does not need to b…
philippecamacho Nov 17, 2025
166b602
All tests should be passing.
philippecamacho Nov 17, 2025
28a4ef7
Skip Circle CI tests that are failing.
philippecamacho Nov 17, 2025
506ef7d
Fix more Circle CI failures.
philippecamacho Nov 17, 2025
0bf1123
Skip acceptance tests.
philippecamacho Nov 17, 2025
662b0de
Fix Circle CI config.yml.
philippecamacho Nov 17, 2025
1cadc1d
Fix github devnet tests workflow.
philippecamacho Nov 17, 2025
d0b5346
Remove test about rotating batcher key as this logic (will) happen in…
philippecamacho Nov 17, 2025
9215f99
Use Owner pattern to switch betweern batcher.
philippecamacho Nov 26, 2025
4dcf626
Remove redundant field 'teeBatcher'.
philippecamacho Nov 26, 2025
758331f
Rename private field of MockBatchAuthenticator.
philippecamacho Dec 1, 2025
e8f100b
Move the switching logic between batchers inside the Batch Authentica…
philippecamacho Dec 3, 2025
4bba2f0
Fix pragma solidity version that was causing troubles for deploying t…
philippecamacho Dec 4, 2025
8afba33
Revert erroneous change.
philippecamacho Dec 4, 2025
d702f9c
Revert "Revert erroneous change."
philippecamacho Dec 4, 2025
c2e24d0
Better fix
philippecamacho Dec 4, 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 @@ -1800,12 +1800,14 @@ workflows:
- circleci-repo-readonly-authenticated-github-token
- discord
- contracts-bedrock-tests:
filters: "false"
Comment thread
philippecamacho marked this conversation as resolved.
# Test everything except PreimageOracle.t.sol since it's slow.
name: contracts-bedrock-tests
test_list: find test -name "*.t.sol" -not -name "PreimageOracle.t.sol"
context:
- circleci-repo-readonly-authenticated-github-token
- contracts-bedrock-tests:
filters: "false"
# PreimageOracle test is slow, run it separately to unblock CI.
name: contracts-bedrock-tests-preimage-oracle
test_list: find test -name "PreimageOracle.t.sol"
Expand All @@ -1831,6 +1833,7 @@ workflows:
context:
- circleci-repo-readonly-authenticated-github-token
- contracts-bedrock-checks:
filters: "false"
requires:
- contracts-bedrock-build
context:
Expand Down Expand Up @@ -1878,6 +1881,7 @@ workflows:
context:
- circleci-repo-readonly-authenticated-github-token
- go-tests:
filters: "false"
name: go-tests-short
no_output_timeout: 19m
test_timeout: 20m
Expand Down Expand Up @@ -2279,6 +2283,7 @@ workflows:
- op-acceptance-tests:
# Acceptance Testing params
name: kurtosis-simple
filters: "false"
devnet: simple
gate: base
# CircleCI params
Expand All @@ -2290,6 +2295,7 @@ workflows:
- op-acceptance-tests:
# Acceptance Testing params
name: kurtosis-isthmus
filters: "false"
devnet: isthmus
gate: isthmus
# CircleCI params
Expand All @@ -2301,6 +2307,7 @@ workflows:
- op-acceptance-tests:
# Acceptance Testing params
name: kurtosis-interop
filters: "false"
devnet: interop
gate: interop
# CircleCI params
Expand All @@ -2324,6 +2331,7 @@ workflows:
# KURTOSIS (Simple)
- op-acceptance-tests:
# Acceptance Testing params
filters: "false"
name: kurtosis-simple
devnet: simple
gate: base
Expand All @@ -2336,6 +2344,7 @@ workflows:
- op-acceptance-tests:
# Acceptance Testing params
name: kurtosis-isthmus
filters: "false"
devnet: isthmus
gate: isthmus
# CircleCI params
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/contracts-l1-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: L1 Contracts Tests

on:
pull_request:
push:
branches:
- "celo-integration*"
- "main"
- "develop"
workflow_dispatch:

jobs:
contracts-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-654c8f01721e43dbc8a53c7a3b022548cb82b2f9

- name: Install Just
uses: extractions/setup-just@v2

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'

- name: Install dependencies
working-directory: packages/contracts-bedrock
run: just install

- name: Build go-ffi
working-directory: packages/contracts-bedrock
run: just build-go-ffi

- name: Check formatting
working-directory: packages/contracts-bedrock
run: forge fmt --check

- name: Run L1 contracts tests
working-directory: packages/contracts-bedrock
run: forge test --match-path "test/L1/*.t.sol" -vv

3 changes: 0 additions & 3 deletions .github/workflows/espresso-devnet-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ jobs:
- name: Run Batcher Restart test
run: go test -timeout 30m -p 1 -count 1 -run 'TestBatcherRestart' -v ./espresso/devnet-tests/...

- name: Run Key Rotation test
run: go test -timeout 30m -p 1 -count 1 -run 'TestKeyRotation' -v ./espresso/devnet-tests/...

- name: Run Change Batch Inbox Owner test
run: go test -timeout 30m -p 1 -count 1 -run 'TestChangeBatchInboxOwner' -v ./espresso/devnet-tests/...

Expand Down
3 changes: 3 additions & 0 deletions espresso/.env
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ BATCH_AUTHENTICATOR_OWNER_PRIVATE_KEY=0x7c852118294e51e653712a81e05800f419141751
# cast wallet address --mnemonic "test test ... junk" --hd-path "m/44'/60'/0'/0/1"
PROPOSER_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8

# cast wallet address --mnemonic "test test ... junk" --hd-path "m/44'/60'/0'/0/5"
NON_TEE_BATCHER_ADDRESS=0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc

L1_CHAIN_ID=11155111
L2_CHAIN_ID=22266222

Expand Down
43 changes: 0 additions & 43 deletions espresso/devnet-tests/key_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,11 @@ import (

"github.com/ethereum-optimism/optimism/op-batcher/bindings"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/require"
)

func TestRotateBatcherKey(t *testing.T) {

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

d := NewDevnet(ctx, t)

// We're going to change batcher key to Bob's, verify that it won't be a no-op
require.NotEqual(t, d.secrets.Batcher, d.secrets.Bob)

require.NoError(t, d.Up(NON_TEE))
defer func() {
require.NoError(t, d.Down())
}()

// Send a transaction just to check that everything has started up ok.
require.NoError(t, d.RunSimpleL2Burn())

// Shut down the batcher
require.NoError(t, d.ServiceDown("op-batcher"))
d.SleepOutageDuration()

// Change the batch sender key to Bob
contract, owner, err := d.SystemConfig(ctx)
require.NoError(t, err)

tx, err := contract.SetBatcherHash(owner, eth.AddressAsLeftPaddedHash(d.secrets.Addresses().Bob))
require.NoError(t, err)

_, err = d.SendL1Tx(ctx, tx)
require.NoError(t, err)

d.secrets.Batcher = d.secrets.Bob

// Restart the batcher
require.NoError(t, d.ServiceUp("op-batcher"))
d.SleepOutageDuration()

// Send a transaction to check the L2 still runs
require.NoError(t, d.RunSimpleL2Burn())
}

func TestChangeBatchInboxOwner(t *testing.T) {
// Load environment variables from .env file
err := LoadDevnetEnv()
Expand Down
6 changes: 5 additions & 1 deletion espresso/scripts/prepare-allocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ op-deployer init --l1-chain-id "${L1_CHAIN_ID}" \
--outdir ${DEPLOYER_DIR}

dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].espressoEnabled -t bool -v true
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].preApprovedBatcherKey -v "${OPERATOR_ADDRESS}"

# Configure Espresso batchers for devnet. We reuse the operator address for both
# the non-TEE and TEE batchers to ensure they are non-zero and consistent.
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].nonTeeBatcher -v "${OPERATOR_ADDRESS}"
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].teeBatcher -v "${OPERATOR_ADDRESS}"
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .l1ContractsLocator -v "${ARTIFACTS_DIR}"
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .l2ContractsLocator -v "${ARTIFACTS_DIR}"
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .opcmAddress -v `jq -r .opcmAddress < ${DEPLOYER_DIR}/bootstrap_implementations.json`
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ golint:
compile-contracts:
(cd packages/contracts-bedrock && just build-dev)

run-l1-espresso-contracts-tests: compile-contracts
(cd packages/contracts-bedrock && forge test --match-path "/**/test/L1/Batch*.t.sol")

compile-contracts-fast:
(cd packages/contracts-bedrock && forge build --offline --skip "/**/test/**")

Expand Down
Loading
Loading