We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Message
This is related to the Message struct in polkadot-sdk/substrate/client/network/src/protocol/message.rs:
polkadot-sdk/substrate/client/network/src/protocol/message.rs
/// A network message. #[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)] pub enum Message<Header, Hash, Number, Extrinsic> { /// Status packet. Status(Status<Hash, Number>), /// Block request. BlockRequest(BlockRequest<Hash, Number>), /// Block response. BlockResponse(BlockResponse<Header, Hash, Extrinsic>), /// Block announce. BlockAnnounce(BlockAnnounce<Header>), /// Consensus protocol message. // NOTE: index is incremented by 1 due to transaction-related // message that was removed #[codec(index = 6)] Consensus(ConsensusMessage), /// Remote method call request. RemoteCallRequest(RemoteCallRequest<Hash>), /// Remote method call response. RemoteCallResponse(RemoteCallResponse), /// Remote storage read request. RemoteReadRequest(RemoteReadRequest<Hash>), /// Remote storage read response. RemoteReadResponse(RemoteReadResponse), /// Remote header request. RemoteHeaderRequest(RemoteHeaderRequest<Number>), /// Remote header response. RemoteHeaderResponse(RemoteHeaderResponse<Header>), /// Remote changes request. RemoteChangesRequest(RemoteChangesRequest<Hash>), /// Remote changes response. RemoteChangesResponse(RemoteChangesResponse<Number, Hash>), /// Remote child storage read request. RemoteReadChildRequest(RemoteReadChildRequest<Hash>), /// Batch of consensus protocol messages. // NOTE: index is incremented by 2 due to finality proof related // messages that were removed. #[codec(index = 17)] ConsensusBatch(Vec<ConsensusMessage>), }
This encodes to:
fn encode_to<__CodecOutputEdqy: ::codec::Output + ?::core::marker::Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, ) { match *self { Message::Status(ref aa) => { __codec_dest_edqy.push_byte(0usize as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } Message::BlockRequest(ref aa) => { __codec_dest_edqy.push_byte(1usize as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } Message::BlockResponse(ref aa) => { __codec_dest_edqy.push_byte(2usize as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } Message::BlockAnnounce(ref aa) => { __codec_dest_edqy.push_byte(3usize as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } Message::Consensus(ref aa) => { __codec_dest_edqy.push_byte(6u8 as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } Message::RemoteCallRequest(ref aa) => { __codec_dest_edqy.push_byte(5usize as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } Message::RemoteCallResponse(ref aa) => { __codec_dest_edqy.push_byte(6usize as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } Message::RemoteReadRequest(ref aa) => { __codec_dest_edqy.push_byte(7usize as ::core::primitive::u8); ::codec::Encode::encode_to(aa, __codec_dest_edqy); } ... } } }
Index 6 is used both for Consensus and for RemoteCallResponse
Consensus
RemoteCallResponse
The text was updated successfully, but these errors were encountered:
Uncovered by paritytech/parity-scale-codec#653
We either need to fix this struct or change the parity-scale-codec logic
parity-scale-codec
Related to paritytech/parity-scale-codec#691 as well
Sorry, something went wrong.
serban300
No branches or pull requests
This is related to the
Message
struct inpolkadot-sdk/substrate/client/network/src/protocol/message.rs
:This encodes to:
Index 6 is used both for
Consensus
and forRemoteCallResponse
The text was updated successfully, but these errors were encountered: