diff --git a/config.md b/config.md index 8c2d4fb..357d756 100644 --- a/config.md +++ b/config.md @@ -90,7 +90,7 @@ |Key|Description|Type|Default Value| |---|-----------|----|-------------| |blockTimestamps|Whether to include the block timestamps in the event information|`boolean`|`true` -|catchupDownscaleRegex|An error pattern to check for from JSON/RPC providers if they limit response sizes to eth_getLogs(). If an error is returned from eth_getLogs() and that error matches the configured pattern, the number of logs requested (catchupPageSize) will be reduced automatically.|string|`Response size is larger than.*limit error.` +|catchupDownscaleRegex|An error pattern to check for from JSON/RPC providers if they limit response sizes to eth_getLogs(). If an error is returned from eth_getLogs() and that error matches the configured pattern, the number of logs requested (catchupPageSize) will be reduced automatically.|string|`Response size is larger than.*limit` |catchupPageSize|Number of blocks to query per poll when catching up to the head of the blockchain|`int`|`500` |catchupThreshold|How many blocks behind the chain head an event stream or listener must be on startup, to enter catchup mode|`int`|`500` |checkpointBlockGap|The number of blocks at the head of the chain that should be considered unstable (could be dropped from the canonical chain after a re-org). Unless events with a full set of confirmations are detected, the restart checkpoint will this many blocks behind the chain head.|`int`|`50` diff --git a/internal/ethereum/config.go b/internal/ethereum/config.go index b586043..4a8f837 100644 --- a/internal/ethereum/config.go +++ b/internal/ethereum/config.go @@ -45,7 +45,7 @@ const ( DefaultCatchupPageSize = 500 DefaultEventsCatchupThreshold = 500 - DefaultEventsCatchupDownscaleRegex = "Response size is larger than.*limit error." + DefaultEventsCatchupDownscaleRegex = "Response size is larger than.*limit" DefaultEventsCheckpointBlockGap = 50 DefaultRetryInitDelay = "100ms" diff --git a/internal/ethereum/event_listener_test.go b/internal/ethereum/event_listener_test.go index 87ab8e6..ff104f6 100644 --- a/internal/ethereum/event_listener_test.go +++ b/internal/ethereum/event_listener_test.go @@ -228,7 +228,7 @@ func TestListenerCatchupScalesBackNTimesOnExpectedError(t *testing.T) { Number: ethtypes.NewHexInteger64(1001), } }) - mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(&rpcbackend.RPCError{Message: "Response size is larger than 150MB limit error."}).Times(5) + mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(&rpcbackend.RPCError{Message: "Response size is larger than 150MB limit"}).Times(5) mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(nil).Run(func(args mock.Arguments) { *args[1].(*[]*logJSONRPC) = []*logJSONRPC{sampleTransferLog()} // Cancel the context here so we exit pushing the event @@ -255,7 +255,7 @@ func TestListenerCatchupScalesBackToOne(t *testing.T) { Number: ethtypes.NewHexInteger64(1001), } }) - mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(&rpcbackend.RPCError{Message: "Response size is larger than 150MB limit error."}).Times(50) + mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(&rpcbackend.RPCError{Message: "Response size is larger than 150MB limit"}).Times(50) mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(nil).Run(func(args mock.Arguments) { *args[1].(*[]*logJSONRPC) = []*logJSONRPC{sampleTransferLog()} // Cancel the context here so we exit pushing the event