You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-designissue requires design work to think about how it would best be accomplished.C-complexComplex changes across multiple modules. Possibly will require additional research.S-networkissues related to the dot/network package.T-featthis issue/pr is a new feature or functionality.
The warp sync request handler will respond request that arrives from the sync/warp protocol. The handler has as one dependency the WarpSyncProvider which is an interface that generates the proofs.
type WarpSyncProvider interface {
// Generate proof starting at given block hash. The proof is accumulated until maximum proof
// size is reached.
generate(startHeader: *types.Header) (encodedProof []byte, err error)
// Get current list of authorities. This is supposed to be genesis authorities when starting sync.
current_authorities() []types.Authorities
}
The Warp Proof Request is a SCALE codec structure send through the wire.
Here's a impl suggestion based on substrate
type OutgoingResponse struct {
payload []byte
}
type Request struct {
peer peer.ID
payload []byte
pendingResponse chan OutgoingResponse
}
type WarpSyncRequestHandler struct {
backend WarpSyncProvider
// receive is a channel where the requests acquired in the network
// layer reaches the handler
receiver chan Request
}
func (w *WarpSyncRequestHandler) handleRequest(payload []byte, pendingResponse chan OutgoingResponse) error {
// unmarshal the payload
// use the backend to generate the warp proof
// send the response through pendingResponse channel
}
func (w *WarpSyncRequestHandler) Run() {
for request := w.receiver {
err := w.handleRequest(request.payload, request.pendingResponse)
...
}
}
Acceptance Criteria
Create the p2p protocol using the template /{genesis_hash}/sync/warp
Handling messages that arrives from the network
Creating tests mocking the WarpSyncProvider (backend)
The text was updated successfully, but these errors were encountered:
EclesioMeloJunior
added
S-network
issues related to the dot/network package.
C-complex
Complex changes across multiple modules. Possibly will require additional research.
A-design
issue requires design work to think about how it would best be accomplished.
T-feat
this issue/pr is a new feature or functionality.
labels
Jun 19, 2024
A-designissue requires design work to think about how it would best be accomplished.C-complexComplex changes across multiple modules. Possibly will require additional research.S-networkissues related to the dot/network package.T-featthis issue/pr is a new feature or functionality.
Description
The warp sync request handler will respond request that arrives from the
sync/warp
protocol. The handler has as one dependency theWarpSyncProvider
which is an interface that generates the proofs.The
MAX_RESPONSE_SIZE
is16 * 1024 * 1024
ref WarpSyncProvider trait
The Warp Proof Request is a SCALE codec structure send through the wire.
Here's a impl suggestion based on substrate
Acceptance Criteria
/{genesis_hash}/sync/warp
The text was updated successfully, but these errors were encountered: