-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
network/sync: Panic on unexpected generic response protocol #6581
Comments
Warp request protocols and state requests protocols are initializing their handler supporting 2 protocol names:
They are supporting both We are only checking the new genesis-based format in chain sync |
This is fine, as the main protocol name is always used by substrate to refer to the protocol. Legacy protocol name is only used on the wire. |
Oki doki, thanks for the info 🙏 I believe in that case this is the proper fix: Looking over the litep2p code, we always provide the negotiated protocol (regardless if it is fallback or main): let handle1 = ConfigBuilder::new(ProtocolName::from("/protocol/1/improved"))
.with_max_size(1024usize)
.with_fallback_names(vec![ProtocolName::from("/protocol/1")])
.build();
let handle2 = handle2) = RequestResponseConfig::new(
ProtocolName::from("/protocol/1") ...;
handle1
.send_request(peer2, vec![1, 3, 3, 7], DialOptions::Reject);
handle2.next().await.unwrap(),
RequestResponseEvent::RequestReceived {
peer: peer1,
fallback: None, ...):
handle2.send_response(request_id, vec![1, 3, 3, 8]);
assert_eq!(
handle1.next().await.unwrap(),
RequestResponseEvent::ResponseReceived {
peer: peer2,
request_id,
response: vec![1, 3, 3, 8],
fallback: Some(ProtocolName::from("/protocol/1")),
}
); Step 1: Initialization
Step 2: handle 1 -> handle 2 request
Step3: handle 1 receives message for fallback
Then into substrate, we parse the received requests as follows: polkadot-sdk/substrate/client/network/src/litep2p/shim/request_response/mod.rs Lines 528 to 530 in 7c5224c
And we forward the protocol fallback if any:
|
Kusama validator is panics on:
polkadot-sdk/substrate/client/network/sync/src/strategy/chain_sync.rs
Lines 640 to 646 in 3906c57
From the log line it looks like the sync engine no longer takes into account the legacy request-response protocol name.
Related PR:
Version deployed: version 1.16.1-ca8beaed148
Logs
Grafana link.
cc @paritytech/networking
The text was updated successfully, but these errors were encountered: