Skip to content

Commit

Permalink
Merge pull request #43 from Layr-Labs/compatibility-with-op-1.7.7
Browse files Browse the repository at this point in the history
Compatibility with op 1.7.7
  • Loading branch information
teddyknox authored Jun 19, 2024
2 parents e5b7e2a + 360d2e9 commit df0eac0
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .devnet/devnetL1.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"respectedGameType": 254,
"useFaultProofs": true,
"usePlasma": true,
"daChallengeWindow": 1,
"daResolveWindow": 1,
"daChallengeWindow": 1000,
"daResolveWindow": 1000,
"daBondSize": 1000000,
"daResolverRefundPercentage": 0
}
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

const (
// NOTE: this will need to be updated as plasma's implementation changes
decodingOffset = 2
decodingOffset = 3
)

// TODO: Add support for custom http client option
Expand Down Expand Up @@ -71,7 +71,7 @@ func (c *client) GetData(ctx context.Context, cert *common.Certificate, domain c
}

// encode prefix bytes
b = eigenda.GenericPrefix(eigenda.Commitment(b).Encode())
b = eigenda.Commitment(b).Encode()

url := fmt.Sprintf("%s/get/0x%x?domain=%s", c.cfg.URL, b, domain.String())

Expand Down
9 changes: 6 additions & 3 deletions e2e/optimism_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/Layr-Labs/eigenda-proxy/e2e"

"github.com/ethereum-optimism/optimism/op-e2e/actions"
"github.com/ethereum-optimism/optimism/op-e2e/config"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/sources"
Expand Down Expand Up @@ -50,6 +51,7 @@ func NewL2PlasmaDA(t actions.Testing, daHost string) *L2PlasmaDA {

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

config.DeployConfig.DACommitmentType = plasma.GenericCommitmentString
dp := e2eutils.MakeDeployParams(t, p)
dp.DeployConfig.DAChallengeProxy = common.Address{0x42}
sd := e2eutils.Setup(t, dp, defaultAlloc)
Expand All @@ -71,6 +73,8 @@ func NewL2PlasmaDA(t actions.Testing, daHost string) *L2PlasmaDA {
plasmaCfg, err := sd.RollupCfg.GetOPPlasmaConfig()
require.NoError(t, err)

plasmaCfg.CommitmentType = plasma.GenericCommitmentType

daMgr := plasma.NewPlasmaDAWithStorage(log, plasmaCfg, storage, &plasma.NoopMetrics{})

enabled := sd.RollupCfg.PlasmaEnabled()
Expand All @@ -87,7 +91,6 @@ func NewL2PlasmaDA(t actions.Testing, daHost string) *L2PlasmaDA {
storage: storage,
daMgr: daMgr,
plasmaCfg: plasmaCfg,
// contract: contract,
batcher: batcher,
sequencer: sequencer,
engine: engine,
Expand Down Expand Up @@ -160,6 +163,6 @@ func TestOptimism(gt *testing.T) {
// assert that EigenDA proxy's was written and read from
stat := proxyTS.Server.Store().Stats()

require.Equal(t, stat.Entries, 1)
require.Equal(t, stat.Reads, 1)
require.Equal(t, 1, stat.Entries)
require.Equal(t, 1, stat.Reads)
}
2 changes: 1 addition & 1 deletion eigenda/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
type Commitment []byte

func (c Commitment) Encode() []byte {
return append([]byte{byte(EigenDA), byte(EigenV0)}, c...)
return append([]byte{byte(op_plasma.GenericCommitmentType), byte(EigenDA), byte(EigenV0)}, c...)
}

func GenericPrefix(b []byte) []byte {
Expand Down
60 changes: 37 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ go 1.21
require (
github.com/Layr-Labs/eigenda v0.7.2-0.20240606180508-e90cb7432ca5
github.com/consensys/gnark-crypto v0.12.1
github.com/ethereum-optimism/optimism v1.7.6
github.com/ethereum-optimism/optimism v1.7.7
github.com/ethereum/go-ethereum v1.14.0
github.com/joho/godotenv v1.5.1
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_golang v1.19.1
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.1
)
Expand Down Expand Up @@ -67,12 +67,12 @@ require (
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 // indirect
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240522134500-19555bdbdc95 // indirect
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240603085035-9c8f6081266e // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/ferranbt/fastssz v0.1.2 // indirect
github.com/fjl/memsize v0.0.2 // indirect
github.com/flynn/noise v1.0.0 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.5.0 // indirect
Expand All @@ -93,7 +93,7 @@ require (
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/graph-gophers/graphql-go v1.3.0 // indirect
Expand All @@ -105,7 +105,7 @@ require (
github.com/hashicorp/go-msgpack/v2 v2.1.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.0 // indirect
github.com/hashicorp/golang-lru/arc/v2 v2.0.5 // indirect
github.com/hashicorp/golang-lru/arc/v2 v2.0.7 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/raft v1.6.1 // indirect
github.com/hashicorp/raft-boltdb v0.0.0-20231211162105-6c830fa4535e // indirect
Expand All @@ -123,18 +123,17 @@ require (
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/klauspost/compress v1.17.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.32.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.3.0 // indirect
github.com/libp2p/go-libp2p v0.35.0 // indirect
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
github.com/libp2p/go-libp2p-mplex v0.9.0 // indirect
github.com/libp2p/go-libp2p-pubsub v0.10.1 // indirect
github.com/libp2p/go-libp2p-pubsub v0.11.0 // indirect
github.com/libp2p/go-libp2p-testing v0.12.0 // indirect
github.com/libp2p/go-mplex v0.7.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
Expand All @@ -147,7 +146,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/miekg/dns v1.1.56 // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
Expand All @@ -168,20 +167,35 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/onsi/gomega v1.31.1 // indirect
github.com/opencontainers/runtime-spec v1.1.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect
github.com/pingcap/errors v0.11.4 // indirect
github.com/pion/datachannel v1.5.6 // indirect
github.com/pion/dtls/v2 v2.2.11 // indirect
github.com/pion/ice/v2 v2.3.24 // indirect
github.com/pion/interceptor v0.1.29 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.14 // indirect
github.com/pion/rtp v1.8.6 // indirect
github.com/pion/sctp v1.8.16 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v2 v2.0.18 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.5 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/webrtc/v3 v3.2.40 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
github.com/quic-go/quic-go v0.39.4 // indirect
github.com/quic-go/webtransport-go v0.6.0 // indirect
github.com/quic-go/quic-go v0.44.0 // indirect
github.com/quic-go/webtransport-go v0.8.0 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
Expand All @@ -204,23 +218,23 @@ require (
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/automaxprocs v1.5.2 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/fx v1.20.1 // indirect
go.uber.org/fx v1.21.1 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.20.0 // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit df0eac0

Please sign in to comment.