From b8dde3992617ba1c51f02756cb40bd7da40f0837 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Thu, 1 Apr 2021 14:43:48 -0700 Subject: [PATCH 1/3] update get events rpc methods 1 - add maximum height query range 2 - retrieve headers rather than blocks from storage (we anyway only need the ID) --- cmd/access/main.go | 1 + engine/access/access_test.go | 3 +++ engine/access/rpc/backend/backend.go | 4 +++- engine/access/rpc/backend/backend_events.go | 16 +++++++++----- engine/access/rpc/backend/backend_test.go | 21 +++++++++++++++++++ .../rpc/backend/historical_access_test.go | 2 ++ engine/access/rpc/backend/retry_test.go | 4 ++-- engine/access/rpc/engine.go | 2 ++ 8 files changed, 45 insertions(+), 8 deletions(-) diff --git a/cmd/access/main.go b/cmd/access/main.go index 4fa03a3d84e..f462c4b012d 100644 --- a/cmd/access/main.go +++ b/cmd/access/main.go @@ -92,6 +92,7 @@ func main() { flags.StringVarP(&rpcConf.HistoricalAccessAddrs, "historical-access-addr", "", "", "comma separated rpc addresses for historical access nodes") flags.DurationVar(&rpcConf.CollectionClientTimeout, "collection-client-timeout", 3*time.Second, "grpc client timeout for a collection node") flags.DurationVar(&rpcConf.ExecutionClientTimeout, "execution-client-timeout", 3*time.Second, "grpc client timeout for an execution node") + flags.UintVar(&rpcConf.MaxHeightRange, "rpc-max-height-range", 100, "maximum size for height range requests") flags.StringSliceVar(&rpcConf.PreferredExecutionNodeIDs, "preferred-execution-node-ids", nil, "comma separated list of execution nodes ids to choose from when making an upstream call e.g. b4a4dbdcd443d...,fb386a6a... etc.") flags.StringSliceVar(&rpcConf.FixedExecutionNodeIDs, "fixed-execution-node-ids", nil, "comma separated list of execution nodes ids to choose from when making an upstream call if no matching preferred execution id is found e.g. b4a4dbdcd443d...,fb386a6a... etc.") flags.BoolVar(&logTxTimeToFinalized, "log-tx-time-to-finalized", false, "log transaction time to finalized") diff --git a/engine/access/access_test.go b/engine/access/access_test.go index 0d67fe3c386..53cca8d3f61 100644 --- a/engine/access/access_test.go +++ b/engine/access/access_test.go @@ -111,6 +111,7 @@ func (suite *Suite) RunTest( suite.metrics, nil, false, + 100, nil, nil, suite.log, @@ -286,6 +287,7 @@ func (suite *Suite) TestSendTransactionToRandomCollectionNode() { metrics, connFactory, // passing in the connection factory false, + 100, nil, nil, suite.log, @@ -518,6 +520,7 @@ func (suite *Suite) TestExecuteScript() { suite.metrics, connFactory, false, + 100, nil, nil, suite.log, diff --git a/engine/access/rpc/backend/backend.go b/engine/access/rpc/backend/backend.go index 94021807b17..e981c8f5fad 100644 --- a/engine/access/rpc/backend/backend.go +++ b/engine/access/rpc/backend/backend.go @@ -68,6 +68,7 @@ func New( transactionMetrics module.TransactionMetrics, connFactory ConnectionFactory, retryEnabled bool, + maxHeightRange uint, preferredExecutionNodeIDs []string, fixedExecutionNodeIDs []string, log zerolog.Logger, @@ -108,10 +109,11 @@ func New( backendEvents: backendEvents{ staticExecutionRPC: executionRPC, state: state, - blocks: blocks, + headers: headers, executionReceipts: executionReceipts, connFactory: connFactory, log: log, + maxHeightRange: maxHeightRange, }, backendBlockHeaders: backendBlockHeaders{ headers: headers, diff --git a/engine/access/rpc/backend/backend_events.go b/engine/access/rpc/backend/backend_events.go index a580d12a7ce..ead656c2de1 100644 --- a/engine/access/rpc/backend/backend_events.go +++ b/engine/access/rpc/backend/backend_events.go @@ -20,11 +20,12 @@ import ( type backendEvents struct { staticExecutionRPC execproto.ExecutionAPIClient - blocks storage.Blocks + headers storage.Headers executionReceipts storage.ExecutionReceipts state protocol.State connFactory ConnectionFactory log zerolog.Logger + maxHeightRange uint } // GetEventsForHeightRange retrieves events for all sealed blocks between the start block height and @@ -60,12 +61,12 @@ func (b *backendEvents) GetEventsForHeightRange( blockHeaders := make([]*flow.Header, 0) for i := startHeight; i <= endHeight; i++ { - block, err := b.blocks.ByHeight(i) + header, err := b.headers.ByHeight(i) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get events: %v", err) } - blockHeaders = append(blockHeaders, block.Header) + blockHeaders = append(blockHeaders, header) } return b.getBlockEventsFromExecutionNode(ctx, blockHeaders, eventType) @@ -81,12 +82,12 @@ func (b *backendEvents) GetEventsForBlockIDs( // find the block headers for all the block IDs blockHeaders := make([]*flow.Header, 0) for _, blockID := range blockIDs { - block, err := b.blocks.ByID(blockID) + header, err := b.headers.ByBlockID(blockID) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get events: %v", err) } - blockHeaders = append(blockHeaders, block.Header) + blockHeaders = append(blockHeaders, header) } // forward the request to the execution node @@ -109,6 +110,11 @@ func (b *backendEvents) getBlockEventsFromExecutionNode( return []flow.BlockEvents{}, nil } + // limit height range queries + if uint(len(blockIDs)) > b.maxHeightRange { + return nil, fmt.Errorf("requested block range (%d) exceeded maximum (%d)", len(blockIDs), b.maxHeightRange) + } + req := execproto.GetEventsForBlockIDsRequest{ Type: eventType, BlockIds: convert.IdentifiersToMessages(blockIDs), diff --git a/engine/access/rpc/backend/backend_test.go b/engine/access/rpc/backend/backend_test.go index 152de96ab59..3454bc50195 100644 --- a/engine/access/rpc/backend/backend_test.go +++ b/engine/access/rpc/backend/backend_test.go @@ -86,6 +86,7 @@ func (suite *Suite) TestPing() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -110,6 +111,7 @@ func (suite *Suite) TestGetLatestFinalizedBlockHeader() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -141,6 +143,7 @@ func (suite *Suite) TestGetLatestProtocolStateSnapshot() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -173,6 +176,7 @@ func (suite *Suite) TestGetLatestSealedBlockHeader() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -210,6 +214,7 @@ func (suite *Suite) TestGetTransaction() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -243,6 +248,7 @@ func (suite *Suite) TestGetCollection() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -325,6 +331,7 @@ func (suite *Suite) TestTransactionStatusTransition() { metrics.NewNoopCollector(), connFactory, false, + 100, nil, nil, suite.log, @@ -443,6 +450,7 @@ func (suite *Suite) TestTransactionExpiredStatusTransition() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -603,6 +611,7 @@ func (suite *Suite) TestTransactionPendingToFinalizedStatusTransition() { metrics.NewNoopCollector(), connFactory, false, + 100, nil, nil, suite.log, @@ -656,6 +665,7 @@ func (suite *Suite) TestTransactionResultUnknown() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -695,6 +705,7 @@ func (suite *Suite) TestGetLatestFinalizedBlock() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -817,6 +828,7 @@ func (suite *Suite) TestGetEventsForBlockIDs() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -842,6 +854,7 @@ func (suite *Suite) TestGetEventsForBlockIDs() { metrics.NewNoopCollector(), connFactory, // the connection factory should be used to get the execution node client false, + 100, nil, validENIDs.Strings(), // set the fixed EN Identifiers to the generated execution IDs suite.log, @@ -868,6 +881,7 @@ func (suite *Suite) TestGetEventsForBlockIDs() { metrics.NewNoopCollector(), connFactory, // the connection factory should be used to get the execution node client false, + 100, nil, validENIDs.Strings(), suite.log, @@ -970,6 +984,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -1003,6 +1018,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -1035,6 +1051,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -1069,6 +1086,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -1137,6 +1155,7 @@ func (suite *Suite) TestGetAccount() { metrics.NewNoopCollector(), connFactory, false, + 100, nil, nil, suite.log, @@ -1207,6 +1226,7 @@ func (suite *Suite) TestGetAccountAtBlockHeight() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -1234,6 +1254,7 @@ func (suite *Suite) TestGetNetworkParameters() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, diff --git a/engine/access/rpc/backend/historical_access_test.go b/engine/access/rpc/backend/historical_access_test.go index 7616967b6d1..fd0d693ba9a 100644 --- a/engine/access/rpc/backend/historical_access_test.go +++ b/engine/access/rpc/backend/historical_access_test.go @@ -51,6 +51,7 @@ func (suite *Suite) TestHistoricalTransactionResult() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, @@ -107,6 +108,7 @@ func (suite *Suite) TestHistoricalTransaction() { metrics.NewNoopCollector(), nil, false, + 100, nil, nil, suite.log, diff --git a/engine/access/rpc/backend/retry_test.go b/engine/access/rpc/backend/retry_test.go index 63b46abf976..a80c7de942a 100644 --- a/engine/access/rpc/backend/retry_test.go +++ b/engine/access/rpc/backend/retry_test.go @@ -42,7 +42,7 @@ func (suite *Suite) TestTransactionRetry() { // Setup Handler + Retry backend := New(suite.state, suite.execClient, suite.colClient, nil, suite.blocks, suite.headers, suite.collections, suite.transactions, suite.receipts, suite.chainID, metrics.NewNoopCollector(), nil, - false, nil, nil, suite.log) + false, 100, nil, nil, suite.log) retry := newRetry().SetBackend(backend).Activate() backend.retry = retry @@ -105,7 +105,7 @@ func (suite *Suite) TestSuccessfulTransactionsDontRetry() { // Setup Handler + Retry backend := New(suite.state, suite.execClient, suite.colClient, nil, suite.blocks, suite.headers, suite.collections, suite.transactions, suite.receipts, suite.chainID, metrics.NewNoopCollector(), nil, - false, nil, nil, suite.log) + false, 100, nil, nil, suite.log) retry := newRetry().SetBackend(backend).Activate() backend.retry = retry diff --git a/engine/access/rpc/engine.go b/engine/access/rpc/engine.go index 8dad5020d9b..4c456ae33f3 100644 --- a/engine/access/rpc/engine.go +++ b/engine/access/rpc/engine.go @@ -36,6 +36,7 @@ type Config struct { MaxMsgSize int // GRPC max message size ExecutionClientTimeout time.Duration // execution API GRPC client timeout CollectionClientTimeout time.Duration // collection API GRPC client timeout + MaxHeightRange uint // max size of height range requests PreferredExecutionNodeIDs []string // preferred list of upstream execution node IDs FixedExecutionNodeIDs []string // fixed list of execution node IDs to choose from if no node node ID can be chosen from the PreferredExecutionNodeIDs } @@ -133,6 +134,7 @@ func New(log zerolog.Logger, transactionMetrics, connectionFactory, retryEnabled, + config.MaxHeightRange, config.PreferredExecutionNodeIDs, config.FixedExecutionNodeIDs, log, From e3191a2ade06f288a264ff31882e835b99de0bc9 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Thu, 1 Apr 2021 14:58:12 -0700 Subject: [PATCH 2/3] add test case --- engine/access/rpc/backend/backend_test.go | 53 ++++++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/engine/access/rpc/backend/backend_test.go b/engine/access/rpc/backend/backend_test.go index 3454bc50195..3145c8190ea 100644 --- a/engine/access/rpc/backend/backend_test.go +++ b/engine/access/rpc/backend/backend_test.go @@ -737,9 +737,9 @@ func (suite *Suite) TestGetEventsForBlockIDs() { for i := 0; i < n; i++ { b := unittest.BlockFixture() - suite.blocks. - On("ByID", b.ID()). - Return(&b, nil).Twice() + suite.headers. + On("ByBlockID", b.ID()). + Return(b.Header, nil).Twice() headers[i] = b.Header @@ -821,8 +821,8 @@ func (suite *Suite) TestGetEventsForBlockIDs() { suite.state, suite.execClient, // pass the default client nil, nil, - suite.blocks, - nil, nil, nil, + nil, + suite.headers, nil, nil, receipts, suite.chainID, metrics.NewNoopCollector(), @@ -847,8 +847,8 @@ func (suite *Suite) TestGetEventsForBlockIDs() { suite.state, nil, nil, nil, - suite.blocks, - nil, nil, nil, + nil, + suite.headers, nil, nil, suite.receipts, suite.chainID, metrics.NewNoopCollector(), @@ -874,8 +874,8 @@ func (suite *Suite) TestGetEventsForBlockIDs() { suite.state, nil, // no default client, hence the receipts storage should be looked up nil, nil, - suite.blocks, - nil, nil, nil, + nil, + suite.headers, nil, nil, suite.receipts, suite.chainID, metrics.NewNoopCollector(), @@ -917,9 +917,9 @@ func (suite *Suite) TestGetEventsForHeightRange() { for i := min; i <= max; i++ { b := unittest.BlockFixture() - suite.blocks. + suite.headers. On("ByHeight", i). - Return(&b, nil).Once() + Return(b.Header, nil).Once() headers = append(headers, b.Header) } @@ -978,7 +978,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { suite.Run("invalid request max height < min height", func() { backend := New( suite.state, - nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, suite.headers, nil, nil, suite.receipts, suite.chainID, metrics.NewNoopCollector(), @@ -1064,6 +1064,35 @@ func (suite *Suite) TestGetEventsForHeightRange() { suite.Require().Equal(expectedResp, actualResp) }) + // set max height range to 1 and request range of 2 + suite.Run("invalid request exceeding max height range", func() { + headHeight = maxHeight - 1 + setupHeadHeight(headHeight) + blockHeaders = setupStorage(minHeight, headHeight) + + // create handler + backend := New( + suite.state, + suite.execClient, + nil, nil, + suite.blocks, + suite.headers, + nil, nil, + suite.receipts, + suite.chainID, + metrics.NewNoopCollector(), + nil, + false, + 1, // set maximum range to 1 + nil, + nil, + suite.log, + ) + + _, err := backend.GetEventsForHeightRange(ctx, string(flow.EventAccountCreated), minHeight, minHeight+1) + suite.Require().Error(err) + }) + suite.Run("invalid request last_sealed_block_height < min height", func() { // set sealed height to one less than the request start height From 2de2e1024dbfbd45847b3d6aeacf7de8b7a67e95 Mon Sep 17 00:00:00 2001 From: Jordan Schalm Date: Thu, 1 Apr 2021 15:43:12 -0700 Subject: [PATCH 3/3] constant for default max height range --- cmd/access/main.go | 2 +- engine/access/access_test.go | 6 +-- engine/access/rpc/backend/backend.go | 3 ++ engine/access/rpc/backend/backend_test.go | 38 +++++++++---------- .../rpc/backend/historical_access_test.go | 4 +- engine/access/rpc/backend/retry_test.go | 4 +- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/cmd/access/main.go b/cmd/access/main.go index f462c4b012d..58da548726e 100644 --- a/cmd/access/main.go +++ b/cmd/access/main.go @@ -92,7 +92,7 @@ func main() { flags.StringVarP(&rpcConf.HistoricalAccessAddrs, "historical-access-addr", "", "", "comma separated rpc addresses for historical access nodes") flags.DurationVar(&rpcConf.CollectionClientTimeout, "collection-client-timeout", 3*time.Second, "grpc client timeout for a collection node") flags.DurationVar(&rpcConf.ExecutionClientTimeout, "execution-client-timeout", 3*time.Second, "grpc client timeout for an execution node") - flags.UintVar(&rpcConf.MaxHeightRange, "rpc-max-height-range", 100, "maximum size for height range requests") + flags.UintVar(&rpcConf.MaxHeightRange, "rpc-max-height-range", backend.DefaultMaxHeightRange, "maximum size for height range requests") flags.StringSliceVar(&rpcConf.PreferredExecutionNodeIDs, "preferred-execution-node-ids", nil, "comma separated list of execution nodes ids to choose from when making an upstream call e.g. b4a4dbdcd443d...,fb386a6a... etc.") flags.StringSliceVar(&rpcConf.FixedExecutionNodeIDs, "fixed-execution-node-ids", nil, "comma separated list of execution nodes ids to choose from when making an upstream call if no matching preferred execution id is found e.g. b4a4dbdcd443d...,fb386a6a... etc.") flags.BoolVar(&logTxTimeToFinalized, "log-tx-time-to-finalized", false, "log transaction time to finalized") diff --git a/engine/access/access_test.go b/engine/access/access_test.go index 53cca8d3f61..ffdd0e4c1d8 100644 --- a/engine/access/access_test.go +++ b/engine/access/access_test.go @@ -111,7 +111,7 @@ func (suite *Suite) RunTest( suite.metrics, nil, false, - 100, + backend.DefaultMaxHeightRange, nil, nil, suite.log, @@ -287,7 +287,7 @@ func (suite *Suite) TestSendTransactionToRandomCollectionNode() { metrics, connFactory, // passing in the connection factory false, - 100, + backend.DefaultMaxHeightRange, nil, nil, suite.log, @@ -520,7 +520,7 @@ func (suite *Suite) TestExecuteScript() { suite.metrics, connFactory, false, - 100, + backend.DefaultMaxHeightRange, nil, nil, suite.log, diff --git a/engine/access/rpc/backend/backend.go b/engine/access/rpc/backend/backend.go index e981c8f5fad..d00406006ac 100644 --- a/engine/access/rpc/backend/backend.go +++ b/engine/access/rpc/backend/backend.go @@ -23,6 +23,9 @@ import ( // maxExecutionNodesCnt is the max number of execution nodes that will be contacted to complete an execution api request const maxExecutionNodesCnt = 3 +// DefaultMaxHeightRange is the default maximum size of range requests. +const DefaultMaxHeightRange = 250 + var preferredENIdentifiers flow.IdentifierList var fixedENIdentifiers flow.IdentifierList diff --git a/engine/access/rpc/backend/backend_test.go b/engine/access/rpc/backend/backend_test.go index 3145c8190ea..f5fb42c97c9 100644 --- a/engine/access/rpc/backend/backend_test.go +++ b/engine/access/rpc/backend/backend_test.go @@ -86,7 +86,7 @@ func (suite *Suite) TestPing() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -111,7 +111,7 @@ func (suite *Suite) TestGetLatestFinalizedBlockHeader() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -176,7 +176,7 @@ func (suite *Suite) TestGetLatestSealedBlockHeader() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -214,7 +214,7 @@ func (suite *Suite) TestGetTransaction() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -248,7 +248,7 @@ func (suite *Suite) TestGetCollection() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -331,7 +331,7 @@ func (suite *Suite) TestTransactionStatusTransition() { metrics.NewNoopCollector(), connFactory, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -450,7 +450,7 @@ func (suite *Suite) TestTransactionExpiredStatusTransition() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -665,7 +665,7 @@ func (suite *Suite) TestTransactionResultUnknown() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -705,7 +705,7 @@ func (suite *Suite) TestGetLatestFinalizedBlock() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -828,7 +828,7 @@ func (suite *Suite) TestGetEventsForBlockIDs() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -854,7 +854,7 @@ func (suite *Suite) TestGetEventsForBlockIDs() { metrics.NewNoopCollector(), connFactory, // the connection factory should be used to get the execution node client false, - 100, + DefaultMaxHeightRange, nil, validENIDs.Strings(), // set the fixed EN Identifiers to the generated execution IDs suite.log, @@ -881,7 +881,7 @@ func (suite *Suite) TestGetEventsForBlockIDs() { metrics.NewNoopCollector(), connFactory, // the connection factory should be used to get the execution node client false, - 100, + DefaultMaxHeightRange, nil, validENIDs.Strings(), suite.log, @@ -984,7 +984,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -1018,7 +1018,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -1051,7 +1051,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -1115,7 +1115,7 @@ func (suite *Suite) TestGetEventsForHeightRange() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -1184,7 +1184,7 @@ func (suite *Suite) TestGetAccount() { metrics.NewNoopCollector(), connFactory, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -1255,7 +1255,7 @@ func (suite *Suite) TestGetAccountAtBlockHeight() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -1283,7 +1283,7 @@ func (suite *Suite) TestGetNetworkParameters() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, diff --git a/engine/access/rpc/backend/historical_access_test.go b/engine/access/rpc/backend/historical_access_test.go index fd0d693ba9a..61bbc3493ae 100644 --- a/engine/access/rpc/backend/historical_access_test.go +++ b/engine/access/rpc/backend/historical_access_test.go @@ -51,7 +51,7 @@ func (suite *Suite) TestHistoricalTransactionResult() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, @@ -108,7 +108,7 @@ func (suite *Suite) TestHistoricalTransaction() { metrics.NewNoopCollector(), nil, false, - 100, + DefaultMaxHeightRange, nil, nil, suite.log, diff --git a/engine/access/rpc/backend/retry_test.go b/engine/access/rpc/backend/retry_test.go index a80c7de942a..9145e7cd63c 100644 --- a/engine/access/rpc/backend/retry_test.go +++ b/engine/access/rpc/backend/retry_test.go @@ -42,7 +42,7 @@ func (suite *Suite) TestTransactionRetry() { // Setup Handler + Retry backend := New(suite.state, suite.execClient, suite.colClient, nil, suite.blocks, suite.headers, suite.collections, suite.transactions, suite.receipts, suite.chainID, metrics.NewNoopCollector(), nil, - false, 100, nil, nil, suite.log) + false, DefaultMaxHeightRange, nil, nil, suite.log) retry := newRetry().SetBackend(backend).Activate() backend.retry = retry @@ -105,7 +105,7 @@ func (suite *Suite) TestSuccessfulTransactionsDontRetry() { // Setup Handler + Retry backend := New(suite.state, suite.execClient, suite.colClient, nil, suite.blocks, suite.headers, suite.collections, suite.transactions, suite.receipts, suite.chainID, metrics.NewNoopCollector(), nil, - false, 100, nil, nil, suite.log) + false, DefaultMaxHeightRange, nil, nil, suite.log) retry := newRetry().SetBackend(backend).Activate() backend.retry = retry