Skip to content

Commit d4ef8c5

Browse files
authored
Update Optimism dependency to OP-Stack 1.9.2 (#150)
Updates: * optimism v1.9.0 -> v1.9.2 * op-geth to the commit 110c433a2469 which is used by optimism v1.9.2 * removed unnecessary version replacements * go-kzg-4844 now uses v1.0.0 * pebble now uses v1.1.2 Necessary code changes: * opio is now ctxinterrupt * plasma is now alt-da
1 parent 15b10fd commit d4ef8c5

File tree

8 files changed

+225
-242
lines changed

8 files changed

+225
-242
lines changed

.devnet/devnetL1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"disputeGameFinalityDelaySeconds": 6,
6666
"respectedGameType": 254,
6767
"useFaultProofs": true,
68-
"usePlasma": true,
68+
"useAltDA": true,
6969
"daCommitmentType": "KeccakCommitment",
7070
"daChallengeWindow": 16,
7171
"daResolveWindow": 16,

cmd/server/entrypoint.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/Layr-Labs/eigenda-proxy/server"
99
"github.com/urfave/cli/v2"
1010

11+
"github.com/ethereum-optimism/optimism/op-service/ctxinterrupt"
1112
oplog "github.com/ethereum-optimism/optimism/op-service/log"
12-
"github.com/ethereum-optimism/optimism/op-service/opio"
1313
)
1414

1515
func StartProxySvr(cliCtx *cli.Context) error {
@@ -63,7 +63,5 @@ func StartProxySvr(cliCtx *cli.Context) error {
6363
m.RecordUp()
6464
}
6565

66-
opio.BlockOnInterrupts()
67-
68-
return nil
66+
return ctxinterrupt.Wait(cliCtx.Context)
6967
}

cmd/server/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"github.com/Layr-Labs/eigenda-proxy/metrics"
1212
"github.com/Layr-Labs/eigenda-proxy/server"
1313
"github.com/ethereum-optimism/optimism/op-service/cliapp"
14+
"github.com/ethereum-optimism/optimism/op-service/ctxinterrupt"
1415
oplog "github.com/ethereum-optimism/optimism/op-service/log"
1516
"github.com/ethereum-optimism/optimism/op-service/metrics/doc"
16-
"github.com/ethereum-optimism/optimism/op-service/opio"
1717
)
1818

1919
var (
@@ -46,7 +46,7 @@ func main() {
4646
}
4747
}
4848

49-
ctx := opio.WithInterruptBlocker(context.Background())
49+
ctx := ctxinterrupt.WithSignalWaiterMain(context.Background())
5050
err := app.RunContext(ctx, os.Args)
5151
if err != nil {
5252
log.Crit("Application failed", "message", err)

e2e/optimism_test.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"testing"
55

66
"github.com/Layr-Labs/eigenda-proxy/e2e"
7+
altda "github.com/ethereum-optimism/optimism/op-alt-da"
78
"github.com/ethereum-optimism/optimism/op-e2e/actions"
89
"github.com/ethereum-optimism/optimism/op-e2e/config"
910
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
10-
plasma "github.com/ethereum-optimism/optimism/op-plasma"
1111
"github.com/ethereum-optimism/optimism/op-service/sources"
1212
"github.com/ethereum-optimism/optimism/op-service/testlog"
1313
"github.com/ethereum/go-ethereum/common"
@@ -17,12 +17,12 @@ import (
1717

1818
var defaultAlloc = &e2eutils.AllocParams{PrefundTestUsers: true}
1919

20-
// L2PlasmaDA is a test harness for manipulating plasma DA state.
21-
type L2PlasmaDA struct {
20+
// L2AltDA is a test harness for manipulating altda DA state.
21+
type L2AltDA struct {
2222
log log.Logger
23-
storage *plasma.DAClient
24-
daMgr *plasma.DA
25-
plasmaCfg plasma.Config
23+
storage *altda.DAClient
24+
daMgr *altda.DA
25+
altdaCfg altda.Config
2626
batcher *actions.L2Batcher
2727
sequencer *actions.L2Sequencer
2828
engine *actions.L2Engine
@@ -32,30 +32,30 @@ type L2PlasmaDA struct {
3232
miner *actions.L1Miner
3333
}
3434

35-
func (a *L2PlasmaDA) ActL1Blocks(t actions.Testing, n uint64) {
35+
func (a *L2AltDA) ActL1Blocks(t actions.Testing, n uint64) {
3636
for i := uint64(0); i < n; i++ {
3737
a.miner.ActL1StartBlock(12)(t)
3838
a.miner.ActL1EndBlock(t)
3939
}
4040
}
4141

42-
func NewL2PlasmaDA(t actions.Testing, daHost string, altDA bool) *L2PlasmaDA {
42+
func NewL2AltDA(t actions.Testing, daHost string, altDA bool) *L2AltDA {
4343
p := &e2eutils.TestParams{
4444
MaxSequencerDrift: 40,
4545
SequencerWindowSize: 120,
4646
ChannelTimeout: 120,
4747
L1BlockTime: 12,
48-
UsePlasma: true,
48+
UseAltDA: true,
4949
}
5050

5151
log := testlog.Logger(t, log.LvlDebug)
5252

53-
config.DeployConfig.DACommitmentType = plasma.GenericCommitmentString
53+
config.DeployConfig.DACommitmentType = altda.GenericCommitmentString
5454
dp := e2eutils.MakeDeployParams(t, p)
5555
dp.DeployConfig.DAChallengeProxy = common.Address{0x42}
5656
sd := e2eutils.Setup(t, dp, defaultAlloc)
5757

58-
require.True(t, sd.RollupCfg.PlasmaEnabled())
58+
require.True(t, sd.RollupCfg.AltDAEnabled())
5959

6060
miner := actions.NewL1Miner(t, log, sd.L1Cfg)
6161
l1Client := miner.EthClient()
@@ -64,41 +64,41 @@ func NewL2PlasmaDA(t actions.Testing, daHost string, altDA bool) *L2PlasmaDA {
6464
engine := actions.NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath)
6565
engCl := engine.EngineClient(t, sd.RollupCfg)
6666

67-
var storage *plasma.DAClient
67+
var storage *altda.DAClient
6868
if !altDA {
69-
storage = plasma.NewDAClient(daHost, true, true)
69+
storage = altda.NewDAClient(daHost, true, true)
7070
} else {
71-
storage = plasma.NewDAClient(daHost, false, false)
71+
storage = altda.NewDAClient(daHost, false, false)
7272
}
7373

7474
l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindBasic))
7575
require.NoError(t, err)
7676

77-
plasmaCfg, err := sd.RollupCfg.GetOPPlasmaConfig()
77+
altdaCfg, err := sd.RollupCfg.GetOPAltDAConfig()
7878
require.NoError(t, err)
7979

8080
if altDA {
81-
plasmaCfg.CommitmentType = plasma.GenericCommitmentType
81+
altdaCfg.CommitmentType = altda.GenericCommitmentType
8282
} else {
83-
plasmaCfg.CommitmentType = plasma.Keccak256CommitmentType
83+
altdaCfg.CommitmentType = altda.Keccak256CommitmentType
8484
}
8585

86-
daMgr := plasma.NewPlasmaDAWithStorage(log, plasmaCfg, storage, &plasma.NoopMetrics{})
86+
daMgr := altda.NewAltDAWithStorage(log, altdaCfg, storage, &altda.NoopMetrics{})
8787

88-
enabled := sd.RollupCfg.PlasmaEnabled()
88+
enabled := sd.RollupCfg.AltDAEnabled()
8989
require.True(t, enabled)
9090

9191
sequencer := actions.NewL2Sequencer(t, log, l1F, nil, daMgr, engCl, sd.RollupCfg, 0)
9292
miner.ActL1SetFeeRecipient(common.Address{'A'})
9393
sequencer.ActL2PipelineFull(t)
9494

95-
batcher := actions.NewL2Batcher(log, sd.RollupCfg, actions.PlasmaBatcherCfg(dp, storage), sequencer.RollupClient(), l1Client, engine.EthClient(), engCl)
95+
batcher := actions.NewL2Batcher(log, sd.RollupCfg, actions.AltDABatcherCfg(dp, storage), sequencer.RollupClient(), l1Client, engine.EthClient(), engCl)
9696

97-
return &L2PlasmaDA{
97+
return &L2AltDA{
9898
log: log,
9999
storage: storage,
100100
daMgr: daMgr,
101-
plasmaCfg: plasmaCfg,
101+
altdaCfg: altdaCfg,
102102
batcher: batcher,
103103
sequencer: sequencer,
104104
engine: engine,
@@ -109,7 +109,7 @@ func NewL2PlasmaDA(t actions.Testing, daHost string, altDA bool) *L2PlasmaDA {
109109
}
110110
}
111111

112-
func (a *L2PlasmaDA) ActL1Finalized(t actions.Testing) {
112+
func (a *L2AltDA) ActL1Finalized(t actions.Testing) {
113113
latest := uint64(2)
114114
a.miner.ActL1Safe(t, latest)
115115
a.miner.ActL1Finalize(t, latest)
@@ -130,7 +130,7 @@ func TestOptimismKeccak256Commitment(gt *testing.T) {
130130

131131
t := actions.NewDefaultTesting(gt)
132132

133-
optimism := NewL2PlasmaDA(t, proxyTS.Address(), false)
133+
optimism := NewL2AltDA(t, proxyTS.Address(), false)
134134

135135
// build L1 block #1
136136
optimism.ActL1Blocks(t, 1)
@@ -184,7 +184,7 @@ func TestOptimismGenericCommitment(gt *testing.T) {
184184

185185
t := actions.NewDefaultTesting(gt)
186186

187-
optimism := NewL2PlasmaDA(t, proxyTS.Address(), true)
187+
optimism := NewL2AltDA(t, proxyTS.Address(), true)
188188

189189
// build L1 block #1
190190
optimism.ActL1Blocks(t, 1)

e2e/server_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
"github.com/Layr-Labs/eigenda-proxy/e2e"
1313
"github.com/Layr-Labs/eigenda-proxy/store"
14-
op_plasma "github.com/ethereum-optimism/optimism/op-plasma"
14+
altda "github.com/ethereum-optimism/optimism/op-alt-da"
1515
"github.com/stretchr/testify/assert"
1616
"github.com/stretchr/testify/require"
1717
)
@@ -25,7 +25,7 @@ func isNilPtrDerefPanic(err string) bool {
2525
strings.Contains(err, "nil pointer dereference")
2626
}
2727

28-
// TestOpClientKeccak256MalformedInputs tests the NewDAClient from op_plasma by setting and getting against []byte("")
28+
// TestOpClientKeccak256MalformedInputs tests the NewDAClient from altda by setting and getting against []byte("")
2929
// preimage. It sets the precompute option to false on the NewDAClient.
3030
func TestOpClientKeccak256MalformedInputs(t *testing.T) {
3131
if !runIntegrationTests || runTestnetIntegrationTests {
@@ -41,15 +41,15 @@ func TestOpClientKeccak256MalformedInputs(t *testing.T) {
4141

4242
// nil commitment. Should return an error but currently is not. This needs to be fixed by OP
4343
// Ref: https://github.com/ethereum-optimism/optimism/issues/11987
44-
// daClient := op_plasma.NewDAClient(ts.Address(), false, true)
44+
// daClient := altda.NewDAClient(ts.Address(), false, true)
4545
// t.Run("nil commitment case", func(t *testing.T) {
46-
// var commit op_plasma.CommitmentData
46+
// var commit altda.CommitmentData
4747
// _, err := daClient.GetInput(ts.Ctx, commit)
4848
// require.Error(t, err)
4949
// assert.True(t, !isPanic(err.Error()))
5050
// })
5151

52-
daClientPcFalse := op_plasma.NewDAClient(ts.Address(), false, false)
52+
daClientPcFalse := altda.NewDAClient(ts.Address(), false, false)
5353

5454
t.Run("input bad data to SetInput & GetInput", func(t *testing.T) {
5555
testPreimage := []byte("") // Empty preimage
@@ -60,7 +60,7 @@ func TestOpClientKeccak256MalformedInputs(t *testing.T) {
6060
assert.True(t, strings.Contains(err.Error(), "invalid input") && !isNilPtrDerefPanic(err.Error()))
6161

6262
// The below test panics silently.
63-
input := op_plasma.NewGenericCommitment([]byte(""))
63+
input := altda.NewGenericCommitment([]byte(""))
6464
_, err = daClientPcFalse.GetInput(ts.Ctx, input)
6565
require.Error(t, err)
6666

@@ -85,7 +85,7 @@ func TestOptimismClientWithKeccak256Commitment(t *testing.T) {
8585
ts, kill := e2e.CreateTestSuite(t, tsConfig)
8686
defer kill()
8787

88-
daClient := op_plasma.NewDAClient(ts.Address(), false, true)
88+
daClient := altda.NewDAClient(ts.Address(), false, true)
8989

9090
t.Run("normal case", func(t *testing.T) {
9191
testPreimage := []byte(e2e.RandString(100))
@@ -114,7 +114,7 @@ func TestKeccak256CommitmentRequestErrorsWhenS3NotSet(t *testing.T) {
114114
ts, kill := e2e.CreateTestSuite(t, tsConfig)
115115
defer kill()
116116

117-
daClient := op_plasma.NewDAClient(ts.Address(), false, true)
117+
daClient := altda.NewDAClient(ts.Address(), false, true)
118118

119119
testPreimage := []byte(e2e.RandString(100))
120120

@@ -139,7 +139,7 @@ func TestOptimismClientWithGenericCommitment(t *testing.T) {
139139
ts, kill := e2e.CreateTestSuite(t, tsConfig)
140140
defer kill()
141141

142-
daClient := op_plasma.NewDAClient(ts.Address(), false, false)
142+
daClient := altda.NewDAClient(ts.Address(), false, false)
143143

144144
testPreimage := []byte(e2e.RandString(100))
145145

0 commit comments

Comments
 (0)