mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 23:21:06 +00:00
Don't pass validators' public keys with attestations (#186)
* Don't pass validators' public keys with attestations * Update statement-table's Misbehaviour typedef * Update network/router * Expand MessageValidationData * Try to fix tests * Extend ApiContext * Remove 'index_mapping' from the SessionParams * Construct index_mapping from authorities * Move index_mapping to TableContext * Add test for index_mapping order
This commit is contained in:
committed by
Robert Habermeier
parent
36dd42523d
commit
e8fcb43fcf
@@ -24,10 +24,7 @@ use substrate_network::Context as NetContext;
|
||||
use substrate_network::consensus_gossip::{TopicNotification, MessageRecipient as GossipMessageRecipient};
|
||||
use polkadot_validation::{Network as ParachainNetwork, SharedTable, Collators, Statement, GenericStatement};
|
||||
use polkadot_primitives::{Block, BlockId, Hash, SessionKey};
|
||||
use polkadot_primitives::parachain::{
|
||||
Id as ParaId, Collation, Extrinsic, ParachainHost, Message, CandidateReceipt,
|
||||
CollatorId, ValidatorId, PoVBlock,
|
||||
};
|
||||
use polkadot_primitives::parachain::{Id as ParaId, Collation, Extrinsic, ParachainHost, Message, CandidateReceipt, CollatorId, ValidatorId, PoVBlock, ValidatorIndex};
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
use futures::prelude::*;
|
||||
@@ -195,13 +192,21 @@ impl<P, E, N, T> ValidationNetwork<P, E, N, T> where
|
||||
let task_executor = self.executor.clone();
|
||||
let exit = self.exit.clone();
|
||||
let message_validator = self.message_validator.clone();
|
||||
let index_mapping = params.authorities
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, k)| (i as ValidatorIndex, k.clone()))
|
||||
.collect();
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
self.network.with_spec(move |spec, ctx| {
|
||||
// before requesting messages, note live consensus session.
|
||||
message_validator.note_session(
|
||||
parent_hash,
|
||||
MessageValidationData { authorities: params.authorities.clone() },
|
||||
MessageValidationData {
|
||||
authorities: params.authorities.clone(),
|
||||
index_mapping,
|
||||
},
|
||||
);
|
||||
|
||||
let session = spec.new_validation_session(ctx, params);
|
||||
|
||||
Reference in New Issue
Block a user