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
2 changes: 0 additions & 2 deletions ctxc/downloader/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription,
notifier.Notify(rpcSub.ID, status)
case <-rpcSub.Err():
return
case <-notifier.Closed():
return
}
}
}()
Expand Down
6 changes: 0 additions & 6 deletions ctxc/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ func (api *FilterAPI) NewPendingTransactions(ctx context.Context) (*rpc.Subscrip
}
case <-rpcSub.Err():
return
case <-notifier.Closed():
return
}
}
}()
Expand Down Expand Up @@ -237,8 +235,6 @@ func (api *FilterAPI) NewHeads(ctx context.Context) (*rpc.Subscription, error) {
notifier.Notify(rpcSub.ID, h)
case <-rpcSub.Err():
return
case <-notifier.Closed():
return
}
}
}()
Expand Down Expand Up @@ -274,8 +270,6 @@ func (api *FilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc.Subsc
}
case <-rpcSub.Err(): // client send an unsubscribe request
return
case <-notifier.Closed(): // connection dropped
return
}
}
}()
Expand Down
2 changes: 1 addition & 1 deletion ctxc/filters/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestUnmarshalJSONNewFilterArgs(t *testing.T) {

// from, to block number
var test1 FilterCriteria
vector := fmt.Sprintf(`{"fromBlock":"%#x","toBlock":"%#x"}`, fromBlock, toBlock)
vector := fmt.Sprintf(`{"fromBlock":"%v","toBlock":"%v"}`, fromBlock, toBlock)
if err := json.Unmarshal([]byte(vector), &test1); err != nil {
t.Fatal(err)
}
Expand Down
10 changes: 5 additions & 5 deletions ctxc/filters/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func TestFilters(t *testing.T) {
rawdb.WriteReceipts(db, block.Hash(), block.NumberU64(), receipts[i])
}
_, sys := newTestFilterSystem(t, db, Config{})
filter := sys.NewRangeFilter(0, -1, []common.Address{addr}, [][]common.Hash{{hash1, hash2, hash3, hash4}})
filter := sys.NewRangeFilter(0, -2, []common.Address{addr}, [][]common.Hash{{hash1, hash2, hash3, hash4}})

logs, _ := filter.Logs(context.Background())
if len(logs) != 4 {
Expand All @@ -193,7 +193,7 @@ func TestFilters(t *testing.T) {
t.Errorf("expected log[0].Topics[0] to be %x, got %x", hash3, logs[0].Topics[0])
}

filter = sys.NewRangeFilter(990, -1, []common.Address{addr}, [][]common.Hash{{hash3}})
filter = sys.NewRangeFilter(990, -2, []common.Address{addr}, [][]common.Hash{{hash3}})
logs, _ = filter.Logs(context.Background())
if len(logs) != 1 {
t.Error("expected 1 log, got", len(logs))
Expand All @@ -210,22 +210,22 @@ func TestFilters(t *testing.T) {
}

failHash := common.BytesToHash([]byte("fail"))
filter = sys.NewRangeFilter(0, -1, nil, [][]common.Hash{{failHash}})
filter = sys.NewRangeFilter(0, -2, nil, [][]common.Hash{{failHash}})

logs, _ = filter.Logs(context.Background())
if len(logs) != 0 {
t.Error("expected 0 log, got", len(logs))
}

failAddr := common.BytesToAddress([]byte("failmenow"))
filter = sys.NewRangeFilter(0, -1, []common.Address{failAddr}, nil)
filter = sys.NewRangeFilter(0, -2, []common.Address{failAddr}, nil)

logs, _ = filter.Logs(context.Background())
if len(logs) != 0 {
t.Error("expected 0 log, got", len(logs))
}

filter = sys.NewRangeFilter(0, -1, nil, [][]common.Hash{{failHash}, {hash1}})
filter = sys.NewRangeFilter(0, -2, nil, [][]common.Hash{{failHash}, {hash1}})

logs, _ = filter.Logs(context.Background())
if len(logs) != 0 {
Expand Down
4 changes: 2 additions & 2 deletions ctxc/tracers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (api *API) TraceChain(ctx context.Context, start, end rpc.BlockNumber, conf
}
sub := notifier.CreateSubscription()

resCh := api.traceChain(from, to, config, notifier.Closed())
resCh := api.traceChain(from, to, config, sub.Err())
go func() {
for result := range resCh {
notifier.Notify(sub.ID, result)
Expand Down Expand Up @@ -284,7 +284,7 @@ func (r *releaser) call() {
// the end block but excludes the start one. The return value will be one item per
// transaction, dependent on the requested tracer.
// The tracing procedure should be aborted in case the closed signal is received.
func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed <-chan any) chan *blockTraceResult {
func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed <-chan error) chan *blockTraceResult {
reexec := defaultTraceReexec
if config != nil && config.Reexec != nil {
reexec = *config.Reexec
Expand Down
42 changes: 21 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1
github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8
github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66
github.com/CortexFoundation/torrentfs v1.0.70-0.20250705184717-83e763fd9aef
github.com/CortexFoundation/torrentfs v1.0.70-0.20250720163701-a81b9d33f725
github.com/Microsoft/go-winio v0.6.2
github.com/VictoriaMetrics/fastcache v1.12.5
github.com/arsham/figurine v1.3.0
github.com/aws/aws-sdk-go-v2 v1.36.5
github.com/aws/aws-sdk-go-v2/config v1.29.17
github.com/aws/aws-sdk-go-v2/credentials v1.17.70
github.com/aws/aws-sdk-go-v2/service/route53 v1.53.0
github.com/aws/aws-sdk-go-v2 v1.36.6
github.com/aws/aws-sdk-go-v2/config v1.29.18
github.com/aws/aws-sdk-go-v2/credentials v1.17.71
github.com/aws/aws-sdk-go-v2/service/route53 v1.53.1
github.com/cespare/cp v1.1.1
github.com/charmbracelet/bubbletea v1.3.6
github.com/cloudflare/cloudflare-go v0.115.0
Expand Down Expand Up @@ -71,7 +72,6 @@ require (
golang.org/x/tools v0.35.0
google.golang.org/protobuf v1.36.6
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
gopkg.in/urfave/cli.v1 v1.20.0
)

Expand All @@ -81,7 +81,7 @@ require (
github.com/CortexFoundation/compress v0.0.0-20240218153512-9074bdc2397c // indirect
github.com/CortexFoundation/cvm-runtime v0.0.0-20221117094012-b5a251885572 // indirect
github.com/CortexFoundation/merkletree v0.0.0-20240407093305-416581a62b5b // indirect
github.com/CortexFoundation/robot v1.0.7-0.20250226143617-b3819ddaddc6 // indirect
github.com/CortexFoundation/robot v1.0.7-0.20250720133840-49217aa96f7e // indirect
github.com/CortexFoundation/wormhole v0.0.2-0.20241128010855-a23c88842cfa // indirect
github.com/DataDog/zstd v1.5.7 // indirect
github.com/RoaringBitmap/roaring v1.9.4 // indirect
Expand All @@ -107,15 +107,15 @@ require (
github.com/antlabs/timer v0.1.4 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/arsham/rainbow v1.2.1 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.32 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.36 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.36 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.33 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.37 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.37 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.34.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.18 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.34.1 // indirect
github.com/aws/smithy-go v1.22.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
Expand All @@ -139,7 +139,7 @@ require (
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/dgraph-io/badger/v4 v4.7.1-0.20250601174320-4f557a74bbf7 // indirect
github.com/dgraph-io/badger/v4 v4.8.0 // indirect
github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
github.com/dlclark/regexp2 v1.11.5 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
Expand Down Expand Up @@ -168,7 +168,7 @@ require (
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/jedib0t/go-pretty/v6 v6.6.7 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
Expand All @@ -185,7 +185,7 @@ require (
github.com/naoina/go-stringutil v0.1.0 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/nutsdb/nutsdb v1.0.4 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/oapi-codegen/runtime v1.1.2 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.9 // indirect
github.com/otiai10/copy v1.14.1 // indirect
Expand All @@ -199,9 +199,9 @@ require (
github.com/pion/mdns/v2 v2.0.7 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.15 // indirect
github.com/pion/rtp v1.8.20 // indirect
github.com/pion/rtp v1.8.21 // indirect
github.com/pion/sctp v1.8.39 // indirect
github.com/pion/sdp/v3 v3.0.14 // indirect
github.com/pion/sdp/v3 v3.0.15 // indirect
github.com/pion/srtp/v3 v3.0.6 // indirect
github.com/pion/stun/v3 v3.0.0 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
Expand Down Expand Up @@ -230,7 +230,7 @@ require (
github.com/tklauser/numcpus v0.10.0 // indirect
github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd // indirect
github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb // indirect
github.com/ucwong/golang-kv v1.0.24-0.20250606215932-9b6cb1d9814d // indirect
github.com/ucwong/golang-kv v1.0.24-0.20250720145037-4c149701f3b8 // indirect
github.com/ucwong/shard v1.0.1-0.20250426172507-f1db2901f62c // indirect
github.com/wlynxg/anet v0.0.5 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
Expand All @@ -244,7 +244,7 @@ require (
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
golang.org/x/exp v0.0.0-20250711185948-6ae5c78190dc // indirect
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect
golang.org/x/mod v0.26.0 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/term v0.33.0 // indirect
Expand Down
Loading