Skip to content

Commit

Permalink
Increase ATX limits again (#5424)
Browse files Browse the repository at this point in the history
## Motivation
With Epoch 13 we expect the number of ATXs to increase above our limits again. This update ensures that nodes can still process the data.

## Changes
- increased limits to handle more ATXs

## Test Plan
n/a

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed
- [x] Update [changelog](../CHANGELOG.md) as needed
  • Loading branch information
fasmat committed Jan 10, 2024
1 parent 5651ada commit 8dcab0b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion datastore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type Config struct {

func DefaultConfig() Config {
return Config{
ATXSize: 600_000,
ATXSize: 1_000_000, // to be in line with fetch.EpochData size (see fetch/wire_types.go)
MalfeasanceSize: 1_000,
}
}
Expand Down
2 changes: 1 addition & 1 deletion fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func DefaultConfig() Config {
return Config{
BatchTimeout: 50 * time.Millisecond,
QueueSize: 20,
BatchSize: 20,
BatchSize: 10,
RequestTimeout: 25 * time.Second,
MaxRetriesForRequest: 100,
ServersConfig: map[string]ServerConfig{
Expand Down
3 changes: 2 additions & 1 deletion fetch/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ func (h *handler) handleEpochInfoReq(ctx context.Context, msg []byte) ([]byte, e
}
h.logger.WithContext(ctx).With().Debug("serve: responded to epoch info request",
epoch,
log.Int("atx_count", len(ed.AtxIDs)))
log.Int("atx_count", len(ed.AtxIDs)),
)
bts, err := codec.Encode(&ed)
if err != nil {
h.logger.WithContext(ctx).With().Fatal("serve: failed to serialize epoch atx", epoch, log.Err(err))
Expand Down
10 changes: 5 additions & 5 deletions fetch/wire_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ type ResponseMessage struct {
// RequestBatch is a batch of requests and a hash of all requests as ID.
type RequestBatch struct {
ID types.Hash32
// depends on fetch config `BatchSize` which defaults to 20, more than 1000 seems unlikely
Requests []RequestMessage `scale:"max=1000"`
// depends on fetch config `BatchSize` which defaults to 10, more than 100 seems unlikely
Requests []RequestMessage `scale:"max=100"`
}

// ResponseBatch is the response struct send for a RequestBatch. the ResponseBatch ID must be the same
// as stated in RequestBatch even if not all Data is present.
type ResponseBatch struct {
ID types.Hash32
// depends on fetch config `BatchSize` which defaults to 20, more than 1000 seems unlikely
Responses []ResponseMessage `scale:"max=1000"`
// depends on fetch config `BatchSize` which defaults to 10, more than 100 seems unlikely
Responses []ResponseMessage `scale:"max=100"`
}

// MeshHashRequest is used by ForkFinder to request the hashes of layers from
Expand Down Expand Up @@ -105,7 +105,7 @@ type MaliciousIDs struct {
}

type EpochData struct {
AtxIDs []types.ATXID `scale:"max=500000"` // for epoch 12 > 300k ATXs are expected, added some safety margin
AtxIDs []types.ATXID `scale:"max=1000000"` // for epoch 13 > 800k ATXs are expected, added some safety margin
}

// LayerData is the data response for a given layer ID.
Expand Down
12 changes: 6 additions & 6 deletions fetch/wire_types_scale.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8dcab0b

Please sign in to comment.