dkg-substrate icon indicating copy to clipboard operation
dkg-substrate copied to clipboard

[BUG] Chain Nonces never gets updated after a Proposal Succeed

Open shekohex opened this issue 4 years ago • 0 comments

Bug Description

ChainNonces which is a Map between ChainId to ProposalNonces is used in two cases:

  1. To check if chain_id is whitelisted or not, by checking that chain_id exists in this map.
  2. To track how many transactions are executed for this chain.

Right now, the first one is good, but the second one is not implemented anywhere when the proposal gets executed here: https://github.com/webb-tools/dkg-substrate/blob/16ea8dca3bda90ba8f448754aac8c89651df05a5/pallets/dkg-proposals/src/lib.rs#L642-L655

Suggested Solution Before Emitting the final event here:

+		ChainNonces::<T>::insert(&src_id, nonce);

Motivation and use-cases

Right now the Relayer needs this to check if we shall send this proposal to the DKG System or not by checking the proposal nonce on the DKG side and the new proposal we have in hand right now and compare the nonces.

shekohex avatar Jan 13 '22 15:01 shekohex