Skip to content

Commit

Permalink
Fix response data slice too small (#6248)
Browse files Browse the repository at this point in the history
## Motivation

The response msg object needs to be increased in size to allow 8.0 Mio ATXs to be processed by the node
  • Loading branch information
fasmat committed Aug 13, 2024
1 parent d21910b commit b7af7bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion fetch/wire_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ type MaliciousIDs struct {

type EpochData struct {
// When changing this value also check
// - the size of `ResponseMessage` above
// - the size of `ResponseMessage.Data` above
// - the size of `Response.Data` in `p2p/server/server.go`
// - the size of `NodeIDs` in `MaliciousIDs` above
// - the size of `Set` in `EpochActiveSet` in common/types/activation.go
// - the size of `EligibilityProofs` in the type `Ballot` in common/types/ballot.go
Expand Down
2 changes: 1 addition & 1 deletion p2p/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (err *ServerError) Error() string {
// Response is a server response.
type Response struct {
// keep in line with limit of ResponseMessage.Data in `fetch/wire_types.go`
Data []byte `scale:"max=209715200"` // 200 MiB > 6.0 mio ATX * 32 bytes per ID
Data []byte `scale:"max=272629760"` // 260 MiB > 8.0 mio ATX * 32 bytes per ID
Error string `scale:"max=1024"` // TODO(mafa): make error code instead of string
}

Expand Down
4 changes: 2 additions & 2 deletions p2p/server/server_scale.go

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

0 comments on commit b7af7bb

Please sign in to comment.