diff --git a/plugin/evm/message/codec.go b/plugin/evm/message/codec.go index ea37200665..5841497ec7 100644 --- a/plugin/evm/message/codec.go +++ b/plugin/evm/message/codec.go @@ -22,7 +22,7 @@ var ( func init() { Codec = codec.NewManager(maxMessageSize) - c := linearcodec.NewDefault() + c := linearcodec.NewCustomMaxLength(maxMessageSize) errs := wrappers.Errs{} errs.Add( @@ -54,7 +54,7 @@ func init() { } CrossChainCodec = codec.NewManager(maxMessageSize) - ccc := linearcodec.NewDefault() + ccc := linearcodec.NewCustomMaxLength(maxMessageSize) errs = wrappers.Errs{} errs.Add( diff --git a/plugin/evm/message/message_test.go b/plugin/evm/message/message_test.go index aa08b6c470..dbcdea2d75 100644 --- a/plugin/evm/message/message_test.go +++ b/plugin/evm/message/message_test.go @@ -63,7 +63,7 @@ func TestEthTxsTooLarge(t *testing.T) { assert := assert.New(t) builtMsg := EthTxsGossip{ - Txs: utils.RandomBytes(1024 * units.KiB), + Txs: utils.RandomBytes(maxMessageSize), } _, err := BuildGossipMessage(Codec, builtMsg) assert.Error(err) diff --git a/sync/client/client.go b/sync/client/client.go index 5b151ddd42..5782590c4d 100644 --- a/sync/client/client.go +++ b/sync/client/client.go @@ -351,7 +351,7 @@ func (c *client) get(ctx context.Context, request message.Request, parseFn parse responseIntf, numElements, err = parseFn(c.codec, request, response) if err != nil { lastErr = err - log.Info("could not validate response, retrying", "nodeID", nodeID, "attempt", attempt, "request", request, "err", err) + log.Debug("could not validate response, retrying", "nodeID", nodeID, "attempt", attempt, "request", request, "err", err) c.networkClient.TrackBandwidth(nodeID, 0) metric.IncFailed() metric.IncInvalidResponse() diff --git a/sync/handlers/block_request_test.go b/sync/handlers/block_request_test.go index 555ebe38f7..55c88abce0 100644 --- a/sync/handlers/block_request_test.go +++ b/sync/handlers/block_request_test.go @@ -167,7 +167,7 @@ func TestBlockRequestHandlerLargeBlocks(t *testing.T) { blocks, _, err := core.GenerateChain(gspec.Config, genesis, engine, memdb, 96, 0, func(i int, b *core.BlockGen) { var data []byte switch { - case i < 32: + case i <= 32: data = make([]byte, units.MiB) default: data = make([]byte, units.MiB/16)