Skip to content
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

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

Closed
shekohex opened this issue Jan 13, 2022 · 1 comment
Closed

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

shekohex opened this issue Jan 13, 2022 · 1 comment
Labels
bug 🪲 Something isn't working p3 🔵 Issues should be resolved eventually

Comments

@shekohex
Copy link
Contributor

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:

/// Execute the proposal and signals the result as an event
fn finalize_execution(
src_id: T::ChainId,
nonce: ProposalNonce,
prop: T::Proposal,
) -> DispatchResultWithPostInfo {
Self::deposit_event(Event::ProposalApproved { chain_id: src_id, proposal_nonce: nonce });
T::ProposalHandler::handle_unsigned_proposal(
prop.into(),
dkg_runtime_primitives::ProposalAction::Sign(0),
)?;
Self::deposit_event(Event::ProposalSucceeded { chain_id: src_id, proposal_nonce: nonce });
Ok(().into())
}

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.

@dutterbutter dutterbutter added the bug 🪲 Something isn't working label Jan 28, 2022
@dutterbutter dutterbutter added the p3 🔵 Issues should be resolved eventually label Jan 31, 2022
@shekohex
Copy link
Contributor Author

shekohex commented Jul 3, 2023

Hey @drewstone this bug is not resolved or completed afaik, it should be added to the backlog instead of forgetting about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working p3 🔵 Issues should be resolved eventually
Projects
Archived in project
Development

No branches or pull requests

3 participants