Skip to content

Commit 7246eb2

Browse files
author
tac0turtle
committed
move deps around
1 parent 716fec2 commit 7246eb2

16 files changed

Lines changed: 1815 additions & 108 deletions

File tree

‎block/manager_test.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
coreda "github.com/rollkit/rollkit/core/da"
2121
coreexecutor "github.com/rollkit/rollkit/core/execution"
2222
coresequencer "github.com/rollkit/rollkit/core/sequencer"
23-
"github.com/rollkit/rollkit/da"
23+
2424
"github.com/rollkit/rollkit/pkg/cache"
2525
"github.com/rollkit/rollkit/pkg/config"
2626
genesispkg "github.com/rollkit/rollkit/pkg/genesis"
@@ -77,7 +77,7 @@ func WithinDuration(t *testing.T, expected, actual, tolerance time.Duration) boo
7777
func getManager(t *testing.T, backend coreda.DA, gasPrice float64, gasMultiplier float64) *Manager {
7878
logger := log.NewTestLogger(t)
7979
return &Manager{
80-
dalc: da.NewDAClient(backend, gasPrice, gasMultiplier, nil, nil, logger),
80+
dalc: coreda.NewDummyClient(backend, []byte("test")),
8181
headerCache: cache.NewCache[types.SignedHeader](),
8282
logger: logger,
8383
gasPrice: gasPrice,
@@ -298,10 +298,10 @@ func TestSubmitBlocksToMockDA(t *testing.T) {
298298
mockDA.On("MaxBlobSize", mock.Anything).Return(uint64(12345), nil)
299299
mockDA.
300300
On("SubmitWithOptions", mock.Anything, blobs, tc.expectedGasPrices[0], []byte(nil), []byte(nil)).
301-
Return([][]byte{}, da.ErrTxTimedOut).Once()
301+
Return([][]byte{}, coreda.ErrTxTimedOut).Once()
302302
mockDA.
303303
On("SubmitWithOptions", mock.Anything, blobs, tc.expectedGasPrices[1], []byte(nil), []byte(nil)).
304-
Return([][]byte{}, da.ErrTxTimedOut).Once()
304+
Return([][]byte{}, coreda.ErrTxTimedOut).Once()
305305
mockDA.
306306
On("SubmitWithOptions", mock.Anything, blobs, tc.expectedGasPrices[2], []byte(nil), []byte(nil)).
307307
Return([][]byte{bytes.Repeat([]byte{0x00}, 8)}, nil)
File renamed without changes.

‎da/cmd/local-da/local.go‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414

1515
"cosmossdk.io/log"
1616
coreda "github.com/rollkit/rollkit/core/da"
17-
"github.com/rollkit/rollkit/da"
1817
)
1918

2019
// DefaultMaxBlobSize is the default max blob size
@@ -98,7 +97,7 @@ func (d *LocalDA) Get(ctx context.Context, ids []coreda.ID, _ []byte) ([]coreda.
9897
}
9998
if !found {
10099
d.logger.Warn("Get: blob not found", "id", id, "height", height)
101-
return nil, da.ErrBlobNotFound
100+
return nil, coreda.ErrBlobNotFound
102101
}
103102
}
104103
d.logger.Debug("Get successful", "count", len(blobs))
@@ -113,7 +112,7 @@ func (d *LocalDA) GetIDs(ctx context.Context, height uint64, _ []byte) (*coreda.
113112

114113
if height > d.height {
115114
d.logger.Error("GetIDs: height in future", "requested", height, "current", d.height)
116-
return nil, fmt.Errorf("height %d is in the future: %w", height, da.ErrFutureHeight)
115+
return nil, fmt.Errorf("height %d is in the future: %w", height, coreda.ErrFutureHeight)
117116
}
118117

119118
kvps, ok := d.data[height]

‎da/da.go‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (dac *DAClient) Submit(ctx context.Context, data [][]byte, maxBlobSize uint
6262
for i := range data {
6363
blob := data[i]
6464
if blobSize+uint64(len(blob)) > maxBlobSize {
65-
message = fmt.Sprint(ErrBlobSizeOverLimit.Error(), "blob size limit reached", "maxBlobSize", maxBlobSize, "index", i, "blobSize", blobSize, "len(blob)", len(blob))
65+
message = fmt.Sprint(coreda.ErrBlobSizeOverLimit.Error(), "blob size limit reached", "maxBlobSize", maxBlobSize, "index", i, "blobSize", blobSize, "len(blob)", len(blob))
6666
dac.Logger.Info(message)
6767
break
6868
}
@@ -82,15 +82,15 @@ func (dac *DAClient) Submit(ctx context.Context, data [][]byte, maxBlobSize uint
8282
if err != nil {
8383
status := coreda.StatusError
8484
switch {
85-
case errors.Is(err, ErrTxTimedOut):
85+
case errors.Is(err, coreda.ErrTxTimedOut):
8686
status = coreda.StatusNotIncludedInBlock
87-
case errors.Is(err, ErrTxAlreadyInMempool):
87+
case errors.Is(err, coreda.ErrTxAlreadyInMempool):
8888
status = coreda.StatusAlreadyInMempool
89-
case errors.Is(err, ErrTxIncorrectAccountSequence):
89+
case errors.Is(err, coreda.ErrTxIncorrectAccountSequence):
9090
status = coreda.StatusAlreadyInMempool
91-
case errors.Is(err, ErrTxTooLarge):
91+
case errors.Is(err, coreda.ErrTxTooLarge):
9292
status = coreda.StatusTooBig
93-
case errors.Is(err, ErrContextDeadline):
93+
case errors.Is(err, coreda.ErrContextDeadline):
9494
status = coreda.StatusContextDeadline
9595
}
9696
return coreda.ResultSubmit{
@@ -138,7 +138,7 @@ func (dac *DAClient) Retrieve(ctx context.Context, dataLayerHeight uint64) cored
138138
return coreda.ResultRetrieve{
139139
BaseResult: coreda.BaseResult{
140140
Code: coreda.StatusNotFound,
141-
Message: ErrBlobNotFound.Error(),
141+
Message: coreda.ErrBlobNotFound.Error(),
142142
Height: dataLayerHeight,
143143
},
144144
}

‎da/da_test.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/stretchr/testify/mock"
1313

1414
coreda "github.com/rollkit/rollkit/core/da"
15-
"github.com/rollkit/rollkit/da/mocks"
15+
"github.com/rollkit/rollkit/test/mocks"
1616
)
1717

1818
const (
@@ -43,7 +43,7 @@ func TestMockDAErrors(t *testing.T) {
4343
On("SubmitWithOptions", mock.Anything, blobs, float64(-1), []byte(nil), []byte(nil)).
4444
// On("SubmitWithOptions", mock.Anything, blobs, float64(-1), []byte(nil), []byte(nil)).
4545
After(submitTimeout).
46-
Return(nil, ErrContextDeadline)
46+
Return(nil, coreda.ErrContextDeadline)
4747
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
4848
defer cancel()
4949

@@ -55,7 +55,7 @@ func TestMockDAErrors(t *testing.T) {
5555
defer cancel()
5656

5757
resp := dalc.Submit(ctx, blobs, maxBlobSize, -1)
58-
assert.Contains(resp.Message, ErrContextDeadline.Error(), "should return context timeout error")
58+
assert.Contains(resp.Message, coreda.ErrContextDeadline.Error(), "should return context timeout error")
5959
})
6060
t.Run("max_blob_size_error", func(t *testing.T) {
6161
mockDA := &mocks.DA{}
@@ -78,7 +78,7 @@ func TestMockDAErrors(t *testing.T) {
7878
mockDA.On("MaxBlobSize", mock.Anything).Return(uint64(1234), nil)
7979
mockDA.
8080
On("SubmitWithOptions", mock.Anything, blobs, float64(-1), []byte(nil), []byte(nil)).
81-
Return([]coreda.ID{}, ErrTxTooLarge)
81+
Return([]coreda.ID{}, coreda.ErrTxTooLarge)
8282

8383
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
8484
defer cancel()
@@ -88,7 +88,7 @@ func TestMockDAErrors(t *testing.T) {
8888
assert.NoError(err)
8989

9090
resp := dalc.Submit(ctx, blobs, maxBlobSize, -1)
91-
assert.Contains(resp.Message, ErrTxTooLarge.Error(), "should return tx too large error")
91+
assert.Contains(resp.Message, coreda.ErrTxTooLarge.Error(), "should return tx too large error")
9292
assert.Equal(resp.Code, coreda.StatusTooBig)
9393
})
9494
}
@@ -253,7 +253,7 @@ func doTestRetrieveNoBlocksFound(t *testing.T, dalc coreda.Client) {
253253
// Namespaces don't work on dummy da right now (https://github.com/rollkit/go-da/issues/94),
254254
// when namespaces are implemented, this should be uncommented
255255
assert.Equal(coreda.StatusNotFound, result.Code)
256-
assert.Contains(result.Message, ErrBlobNotFound.Error())
256+
assert.Contains(result.Message, coreda.ErrBlobNotFound.Error())
257257
assert.Equal(coreda.StatusNotFound, result.Code)
258258
}
259259

‎da/go.mod‎

Lines changed: 145 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,169 @@ replace github.com/rollkit/rollkit/core => ../core
77
replace github.com/rollkit/rollkit => ../
88

99
require (
10-
cosmossdk.io/log v1.5.0
10+
cosmossdk.io/log v1.5.1
1111
github.com/filecoin-project/go-jsonrpc v0.7.1
12-
github.com/rollkit/rollkit/core v0.0.0-00010101000000-000000000000
12+
github.com/rollkit/rollkit v0.0.0-00010101000000-000000000000
13+
github.com/rollkit/rollkit/core v0.0.0-20250312114929-104787ba1a4c
1314
github.com/stretchr/testify v1.10.0
1415
)
1516

1617
require (
17-
github.com/bytedance/sonic v1.12.3 // indirect
18-
github.com/bytedance/sonic/loader v0.2.0 // indirect
19-
github.com/cloudwego/base64x v0.1.4 // indirect
20-
github.com/cloudwego/iasm v0.2.0 // indirect
18+
github.com/benbjohnson/clock v1.3.5 // indirect
19+
github.com/beorn7/perks v1.0.1 // indirect
20+
github.com/bytedance/sonic v1.13.2 // indirect
21+
github.com/bytedance/sonic/loader v0.2.4 // indirect
22+
github.com/celestiaorg/go-header v0.6.5 // indirect
23+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
24+
github.com/cloudwego/base64x v0.1.5 // indirect
25+
github.com/containerd/cgroups v1.1.0 // indirect
26+
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
2127
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
28+
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
29+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
30+
github.com/docker/go-units v0.5.0 // indirect
31+
github.com/elastic/gosigar v0.14.3 // indirect
32+
github.com/flynn/noise v1.1.0 // indirect
33+
github.com/francoispqt/gojay v1.2.13 // indirect
34+
github.com/fsnotify/fsnotify v1.7.0 // indirect
35+
github.com/go-kit/kit v0.13.0 // indirect
36+
github.com/go-logr/logr v1.4.2 // indirect
37+
github.com/go-logr/stdr v1.2.2 // indirect
38+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
39+
github.com/goccy/go-yaml v1.16.0 // indirect
40+
github.com/godbus/dbus/v5 v5.1.0 // indirect
41+
github.com/gogo/protobuf v1.3.2 // indirect
2242
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
43+
github.com/google/gopacket v1.1.19 // indirect
44+
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e // indirect
2345
github.com/google/uuid v1.6.0 // indirect
2446
github.com/gorilla/websocket v1.5.3 // indirect
25-
github.com/ipfs/go-log/v2 v2.0.8 // indirect
26-
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
27-
github.com/kr/pretty v0.3.1 // indirect
28-
github.com/mattn/go-colorable v0.1.13 // indirect
47+
github.com/hashicorp/errwrap v1.1.0 // indirect
48+
github.com/hashicorp/go-multierror v1.1.1 // indirect
49+
github.com/hashicorp/golang-lru v1.0.2 // indirect
50+
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
51+
github.com/hashicorp/hcl v1.0.0 // indirect
52+
github.com/huin/goupnp v1.3.0 // indirect
53+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
54+
github.com/ipfs/boxo v0.27.4 // indirect
55+
github.com/ipfs/go-cid v0.5.0 // indirect
56+
github.com/ipfs/go-datastore v0.8.2 // indirect
57+
github.com/ipfs/go-log v1.0.5 // indirect
58+
github.com/ipfs/go-log/v2 v2.5.1 // indirect
59+
github.com/ipld/go-ipld-prime v0.21.0 // indirect
60+
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
61+
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
62+
github.com/klauspost/compress v1.18.0 // indirect
63+
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
64+
github.com/koron/go-ssdp v0.0.5 // indirect
65+
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
66+
github.com/libp2p/go-cidranger v1.1.0 // indirect
67+
github.com/libp2p/go-flow-metrics v0.2.0 // indirect
68+
github.com/libp2p/go-libp2p v0.41.1 // indirect
69+
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
70+
github.com/libp2p/go-libp2p-kad-dht v0.29.1 // indirect
71+
github.com/libp2p/go-libp2p-kbucket v0.6.5 // indirect
72+
github.com/libp2p/go-libp2p-pubsub v0.13.1 // indirect
73+
github.com/libp2p/go-libp2p-record v0.3.1 // indirect
74+
github.com/libp2p/go-libp2p-routing-helpers v0.7.4 // indirect
75+
github.com/libp2p/go-msgio v0.3.0 // indirect
76+
github.com/libp2p/go-netroute v0.2.2 // indirect
77+
github.com/libp2p/go-reuseport v0.4.0 // indirect
78+
github.com/libp2p/go-yamux/v5 v5.0.0 // indirect
79+
github.com/magiconair/properties v1.8.7 // indirect
80+
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
81+
github.com/mattn/go-colorable v0.1.14 // indirect
2982
github.com/mattn/go-isatty v0.0.20 // indirect
83+
github.com/miekg/dns v1.1.64 // indirect
84+
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
85+
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
86+
github.com/minio/sha256-simd v1.0.1 // indirect
87+
github.com/mitchellh/mapstructure v1.5.0 // indirect
88+
github.com/mr-tron/base58 v1.2.0 // indirect
89+
github.com/multiformats/go-base32 v0.1.0 // indirect
90+
github.com/multiformats/go-base36 v0.2.0 // indirect
91+
github.com/multiformats/go-multiaddr v0.15.0 // indirect
92+
github.com/multiformats/go-multiaddr-dns v0.4.1 // indirect
93+
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
94+
github.com/multiformats/go-multibase v0.2.0 // indirect
95+
github.com/multiformats/go-multicodec v0.9.0 // indirect
96+
github.com/multiformats/go-multihash v0.2.3 // indirect
97+
github.com/multiformats/go-multistream v0.6.0 // indirect
98+
github.com/multiformats/go-varint v0.0.7 // indirect
99+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
100+
github.com/onsi/ginkgo/v2 v2.23.3 // indirect
101+
github.com/opencontainers/runtime-spec v1.2.1 // indirect
102+
github.com/opentracing/opentracing-go v1.2.0 // indirect
103+
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
104+
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
105+
github.com/pion/datachannel v1.5.10 // indirect
106+
github.com/pion/dtls/v2 v2.2.12 // indirect
107+
github.com/pion/dtls/v3 v3.0.5 // indirect
108+
github.com/pion/ice/v4 v4.0.8 // indirect
109+
github.com/pion/interceptor v0.1.37 // indirect
110+
github.com/pion/logging v0.2.3 // indirect
111+
github.com/pion/mdns/v2 v2.0.7 // indirect
112+
github.com/pion/randutil v0.1.0 // indirect
113+
github.com/pion/rtcp v1.2.15 // indirect
114+
github.com/pion/rtp v1.8.13 // indirect
115+
github.com/pion/sctp v1.8.37 // indirect
116+
github.com/pion/sdp/v3 v3.0.11 // indirect
117+
github.com/pion/srtp/v3 v3.0.4 // indirect
118+
github.com/pion/stun v0.6.1 // indirect
119+
github.com/pion/stun/v3 v3.0.0 // indirect
120+
github.com/pion/transport/v2 v2.2.10 // indirect
121+
github.com/pion/transport/v3 v3.0.7 // indirect
122+
github.com/pion/turn/v4 v4.0.0 // indirect
123+
github.com/pion/webrtc/v4 v4.0.14 // indirect
30124
github.com/pkg/errors v0.9.1 // indirect
31125
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
32-
github.com/rogpeppe/go-internal v1.13.1 // indirect
33-
github.com/rs/zerolog v1.33.0 // indirect
126+
github.com/polydawn/refmt v0.89.0 // indirect
127+
github.com/prometheus/client_golang v1.21.1 // indirect
128+
github.com/prometheus/client_model v0.6.1 // indirect
129+
github.com/prometheus/common v0.63.0 // indirect
130+
github.com/prometheus/procfs v0.16.0 // indirect
131+
github.com/quic-go/qpack v0.5.1 // indirect
132+
github.com/quic-go/quic-go v0.50.1 // indirect
133+
github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 // indirect
134+
github.com/raulk/go-watchdog v1.3.0 // indirect
135+
github.com/rs/zerolog v1.34.0 // indirect
136+
github.com/sagikazarmark/locafero v0.4.0 // indirect
137+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
138+
github.com/sourcegraph/conc v0.3.0 // indirect
139+
github.com/spaolacci/murmur3 v1.1.0 // indirect
140+
github.com/spf13/afero v1.11.0 // indirect
141+
github.com/spf13/cast v1.6.0 // indirect
142+
github.com/spf13/cobra v1.9.1 // indirect
143+
github.com/spf13/pflag v1.0.6 // indirect
144+
github.com/spf13/viper v1.19.0 // indirect
34145
github.com/stretchr/objx v0.5.2 // indirect
146+
github.com/subosito/gotenv v1.6.0 // indirect
35147
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
148+
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
149+
github.com/wlynxg/anet v0.0.5 // indirect
36150
go.opencensus.io v0.24.0 // indirect
151+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
152+
go.opentelemetry.io/otel v1.35.0 // indirect
153+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
154+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
155+
go.uber.org/dig v1.18.1 // indirect
156+
go.uber.org/fx v1.23.0 // indirect
157+
go.uber.org/mock v0.5.0 // indirect
37158
go.uber.org/multierr v1.11.0 // indirect
38159
go.uber.org/zap v1.27.0 // indirect
39-
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
160+
golang.org/x/arch v0.15.0 // indirect
161+
golang.org/x/crypto v0.36.0 // indirect
162+
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
163+
golang.org/x/mod v0.24.0 // indirect
164+
golang.org/x/net v0.38.0 // indirect
165+
golang.org/x/sync v0.12.0 // indirect
40166
golang.org/x/sys v0.31.0 // indirect
167+
golang.org/x/text v0.23.0 // indirect
168+
golang.org/x/tools v0.31.0 // indirect
41169
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
42-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
170+
gonum.org/v1/gonum v0.15.1 // indirect
171+
google.golang.org/protobuf v1.36.6 // indirect
172+
gopkg.in/ini.v1 v1.67.0 // indirect
43173
gopkg.in/yaml.v3 v3.0.1 // indirect
174+
lukechampine.com/blake3 v1.4.0 // indirect
44175
)

0 commit comments

Comments
 (0)