Skip to content

Commit fd4109a

Browse files
committed
Merge remote-tracking branch 'origin/main' into mpeter/poc-index-finalized-block-results
2 parents 0e86741 + f84de88 commit fd4109a

15 files changed

Lines changed: 373 additions & 682 deletions

File tree

api/debug.go

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package api
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
7-
"strings"
86

97
gethCommon "github.com/ethereum/go-ethereum/common"
108
gethTypes "github.com/ethereum/go-ethereum/core/types"
@@ -21,9 +19,7 @@ import (
2119
"github.com/onflow/flow-evm-gateway/config"
2220
ethTypes "github.com/onflow/flow-evm-gateway/eth/types"
2321
"github.com/onflow/flow-evm-gateway/models"
24-
errs "github.com/onflow/flow-evm-gateway/models/errors"
2522
"github.com/onflow/flow-evm-gateway/services/evm"
26-
"github.com/onflow/flow-evm-gateway/services/replayer"
2723
"github.com/onflow/flow-evm-gateway/services/requester"
2824
"github.com/onflow/flow-evm-gateway/storage"
2925
"github.com/onflow/flow-evm-gateway/storage/pebble"
@@ -279,28 +275,6 @@ func (d *DebugAPI) traceTransaction(
279275
hash gethCommon.Hash,
280276
config *tracers.TraceConfig,
281277
) (json.RawMessage, error) {
282-
// If the given trace config is equal to the default call tracer used
283-
// in block replay during ingestion, then we fetch the trace result
284-
// from the Traces DB.
285-
if isDefaultCallTracer(config) {
286-
trace, err := d.tracer.GetTransaction(hash)
287-
// If there is no error, we return the trace result from the DB.
288-
if err == nil {
289-
return trace, nil
290-
}
291-
292-
// If we got an error of `ErrEntityNotFound`, for whatever reason,
293-
// we simply re-compute the trace below. If we got any other error,
294-
// we return it.
295-
if !errors.Is(err, errs.ErrEntityNotFound) {
296-
d.logger.Error().Err(err).Msgf(
297-
"failed to retrieve default call trace for tx: %s",
298-
hash,
299-
)
300-
return nil, err
301-
}
302-
}
303-
304278
receipt, err := d.receipts.GetByTransactionID(hash)
305279
if err != nil {
306280
return nil, err
@@ -371,23 +345,6 @@ func (d *DebugAPI) traceBlockByNumber(
371345

372346
results := make([]*txTraceResult, len(block.TransactionHashes))
373347

374-
// If the given trace config is equal to the default call tracer used
375-
// in block replay during ingestion, then we fetch the trace result
376-
// from the Traces DB.
377-
if isDefaultCallTracer(config) {
378-
for i, hash := range block.TransactionHashes {
379-
trace, err := d.traceTransaction(hash, config)
380-
381-
if err != nil {
382-
results[i] = &txTraceResult{TxHash: hash, Error: err.Error()}
383-
} else {
384-
results[i] = &txTraceResult{TxHash: hash, Result: trace}
385-
}
386-
}
387-
388-
return results, nil
389-
}
390-
391348
blockExecutor, err := d.executorAtBlock(block)
392349
if err != nil {
393350
return nil, err
@@ -480,19 +437,3 @@ func (d *DebugAPI) tracerForReceipt(
480437
d.evmChainConfig,
481438
)
482439
}
483-
484-
func isDefaultCallTracer(config *tracers.TraceConfig) bool {
485-
if config == nil {
486-
return false
487-
}
488-
489-
if config.Tracer == nil || *config.Tracer != replayer.TracerName {
490-
return false
491-
}
492-
493-
// The default tracer config is `{"onlyTopCall":true}`, if the user adds
494-
// any whitespace, e.g `{ "onlyTopCall": true }`, the comparison will fail.
495-
// That's why we need to trim out all whitespace characters.
496-
trimmedConfig := strings.ReplaceAll(string(config.TracerConfig), " ", "")
497-
return trimmedConfig == replayer.TracerConfig
498-
}

bootstrap/bootstrap.go

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,14 @@ func (b *Bootstrap) StartEventIngestion(ctx context.Context) error {
192192
)
193193
}
194194

195-
callTracerCollector, err := replayer.NewCallTracerCollector(
196-
b.config.EVMNetworkID,
197-
b.logger,
198-
)
199-
if err != nil {
200-
return err
201-
}
202195
blocksProvider := replayer.NewBlocksProvider(
203196
b.storages.Blocks,
204197
chainID,
205-
callTracerCollector.TxTracer(),
206198
)
207199
replayerConfig := replayer.Config{
208-
ChainID: chainID,
209-
RootAddr: evm.StorageAccountAddress(chainID),
210-
CallTracerCollector: callTracerCollector,
211-
ValidateResults: true,
200+
ChainID: chainID,
201+
RootAddr: evm.StorageAccountAddress(chainID),
202+
ValidateResults: true,
212203
}
213204

214205
// initialize event ingestion engine
@@ -220,7 +211,6 @@ func (b *Bootstrap) StartEventIngestion(ctx context.Context) error {
220211
b.storages.Blocks,
221212
b.storages.Receipts,
222213
b.storages.Transactions,
223-
b.storages.Traces,
224214
b.publishers.Block,
225215
b.publishers.Logs,
226216
b.logger,
@@ -538,7 +528,11 @@ func setupCrossSporkClient(config config.Config, logger zerolog.Logger) (*reques
538528
// if we provided access node previous spork hosts add them to the client
539529
pastSporkClients := make([]access.Client, len(config.AccessNodePreviousSporkHosts))
540530
for i, host := range config.AccessNodePreviousSporkHosts {
541-
grpcClient, err := grpc.NewClient(host)
531+
grpcClient, err := grpc.NewClient(host,
532+
grpc.WithGRPCDialOptions(
533+
grpcOpts.WithDefaultCallOptions(grpcOpts.MaxCallRecvMsgSize(DefaultMaxMessageSize)),
534+
),
535+
)
542536
if err != nil {
543537
return nil, fmt.Errorf("failed to create client connection for host: %s, with error: %w", host, err)
544538
}

go.mod

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ require (
99
github.com/hashicorp/go-multierror v1.1.1
1010
github.com/hashicorp/golang-lru/v2 v2.0.7
1111
github.com/holiman/uint256 v1.3.2
12-
github.com/onflow/atree v0.11.0
13-
github.com/onflow/cadence v1.8.3
14-
github.com/onflow/flow-go v0.44.0
15-
github.com/onflow/flow-go-sdk v1.9.2
12+
github.com/onflow/atree v0.12.0
13+
github.com/onflow/cadence v1.9.4
14+
github.com/onflow/flow-go v0.45.0-experimental-cadence-v1.8.7.0.20260109014156-2abea7b5732a
15+
github.com/onflow/flow-go-sdk v1.9.10
1616
github.com/prometheus/client_golang v1.20.5
1717
github.com/rs/cors v1.8.0
1818
github.com/rs/zerolog v1.33.0
@@ -24,18 +24,18 @@ require (
2424
go.uber.org/atomic v1.11.0
2525
go.uber.org/ratelimit v0.3.1
2626
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
27-
golang.org/x/sync v0.16.0
28-
google.golang.org/grpc v1.75.1
27+
golang.org/x/sync v0.19.0
28+
google.golang.org/grpc v1.78.0
2929
)
3030

3131
require (
32-
cloud.google.com/go v0.120.0 // indirect
33-
cloud.google.com/go/auth v0.16.4 // indirect
32+
cloud.google.com/go v0.121.6 // indirect
33+
cloud.google.com/go/auth v0.18.0 // indirect
3434
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
35-
cloud.google.com/go/compute/metadata v0.8.0 // indirect
36-
cloud.google.com/go/iam v1.5.2 // indirect
37-
cloud.google.com/go/kms v1.23.1 // indirect
38-
cloud.google.com/go/longrunning v0.6.7 // indirect
35+
cloud.google.com/go/compute/metadata v0.9.0 // indirect
36+
cloud.google.com/go/iam v1.5.3 // indirect
37+
cloud.google.com/go/kms v1.23.2 // indirect
38+
cloud.google.com/go/longrunning v0.7.0 // indirect
3939
github.com/DataDog/zstd v1.5.6-0.20230824185856-869dae002e5e // indirect
4040
github.com/Microsoft/go-winio v0.6.2 // indirect
4141
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
@@ -44,7 +44,7 @@ require (
4444
github.com/VictoriaMetrics/fastcache v1.13.0 // indirect
4545
github.com/benbjohnson/clock v1.3.5 // indirect
4646
github.com/beorn7/perks v1.0.1 // indirect
47-
github.com/bits-and-blooms/bitset v1.24.0 // indirect
47+
github.com/bits-and-blooms/bitset v1.24.4 // indirect
4848
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
4949
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
5050
github.com/cespare/xxhash v1.1.0 // indirect
@@ -79,7 +79,7 @@ require (
7979
github.com/ferranbt/fastssz v0.1.4 // indirect
8080
github.com/frankban/quicktest v1.14.4 // indirect
8181
github.com/fsnotify/fsnotify v1.6.0 // indirect
82-
github.com/fxamacker/cbor/v2 v2.8.1-0.20250402194037-6f932b086829 // indirect
82+
github.com/fxamacker/cbor/v2 v2.9.1-0.20251019205732-39888e6be013 // indirect
8383
github.com/fxamacker/circlehash v0.3.0 // indirect
8484
github.com/getsentry/sentry-go v0.27.0 // indirect
8585
github.com/go-logr/logr v1.4.3 // indirect
@@ -94,10 +94,10 @@ require (
9494
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 // indirect
9595
github.com/google/s2a-go v0.1.9 // indirect
9696
github.com/google/uuid v1.6.0 // indirect
97-
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
98-
github.com/googleapis/gax-go/v2 v2.15.0 // indirect
97+
github.com/googleapis/enterprise-certificate-proxy v0.3.7 // indirect
98+
github.com/googleapis/gax-go/v2 v2.16.0 // indirect
9999
github.com/gorilla/websocket v1.5.3 // indirect
100-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
100+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
101101
github.com/hashicorp/errwrap v1.1.0 // indirect
102102
github.com/hashicorp/hcl v1.0.0 // indirect
103103
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
@@ -154,7 +154,7 @@ require (
154154
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
155155
github.com/onflow/flow-nft/lib/go/contracts v1.3.0 // indirect
156156
github.com/onflow/flow-nft/lib/go/templates v1.3.0 // indirect
157-
github.com/onflow/flow/protobuf/go/flow v0.4.18 // indirect
157+
github.com/onflow/flow/protobuf/go/flow v0.4.19 // indirect
158158
github.com/onflow/go-ethereum v1.13.4 // indirect
159159
github.com/onflow/sdks v0.6.0-preview.1 // indirect
160160
github.com/onsi/ginkgo v1.16.4 // indirect
@@ -169,12 +169,12 @@ require (
169169
github.com/pion/transport/v3 v3.0.7 // indirect
170170
github.com/pkg/errors v0.9.1 // indirect
171171
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
172-
github.com/prometheus/client_model v0.6.1 // indirect
172+
github.com/prometheus/client_model v0.6.2 // indirect
173173
github.com/prometheus/common v0.61.0 // indirect
174174
github.com/prometheus/procfs v0.15.1 // indirect
175175
github.com/psiemens/sconfig v0.1.0 // indirect
176176
github.com/rivo/uniseg v0.4.7 // indirect
177-
github.com/rogpeppe/go-internal v1.13.1 // indirect
177+
github.com/rogpeppe/go-internal v1.14.1 // indirect
178178
github.com/samber/lo v1.39.0 // indirect
179179
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
180180
github.com/slok/go-http-metrics v0.12.0 // indirect
@@ -197,32 +197,32 @@ require (
197197
github.com/wlynxg/anet v0.0.5 // indirect
198198
github.com/x448/float16 v0.8.4 // indirect
199199
github.com/zeebo/blake3 v0.2.4 // indirect
200-
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
200+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
201201
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
202202
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
203-
go.opentelemetry.io/otel v1.37.0 // indirect
203+
go.opentelemetry.io/otel v1.38.0 // indirect
204204
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
205205
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect
206-
go.opentelemetry.io/otel/metric v1.37.0 // indirect
207-
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
208-
go.opentelemetry.io/otel/trace v1.37.0 // indirect
209-
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
206+
go.opentelemetry.io/otel/metric v1.38.0 // indirect
207+
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
208+
go.opentelemetry.io/otel/trace v1.38.0 // indirect
209+
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
210210
go.uber.org/multierr v1.11.0 // indirect
211211
go.uber.org/zap v1.27.0 // indirect
212-
golang.org/x/crypto v0.41.0 // indirect
213-
golang.org/x/net v0.43.0 // indirect
214-
golang.org/x/oauth2 v0.30.0 // indirect
215-
golang.org/x/sys v0.36.0 // indirect
216-
golang.org/x/text v0.28.0 // indirect
217-
golang.org/x/time v0.12.0 // indirect
212+
golang.org/x/crypto v0.46.0 // indirect
213+
golang.org/x/net v0.48.0 // indirect
214+
golang.org/x/oauth2 v0.34.0 // indirect
215+
golang.org/x/sys v0.39.0 // indirect
216+
golang.org/x/text v0.32.0 // indirect
217+
golang.org/x/time v0.14.0 // indirect
218218
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
219219
gonum.org/v1/gonum v0.16.0 // indirect
220-
google.golang.org/api v0.247.0 // indirect
220+
google.golang.org/api v0.259.0 // indirect
221221
google.golang.org/appengine v1.6.8 // indirect
222-
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
223-
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
224-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250811230008-5f3141c8851a // indirect
225-
google.golang.org/protobuf v1.36.9 // indirect
222+
google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 // indirect
223+
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
224+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
225+
google.golang.org/protobuf v1.36.11 // indirect
226226
gopkg.in/ini.v1 v1.67.0 // indirect
227227
gopkg.in/yaml.v2 v2.4.0 // indirect
228228
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)