Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

submit emergency solution #11703

Closed
wants to merge 27 commits into from

Conversation

Szegoo
Copy link
Contributor

@Szegoo Szegoo commented Jun 18, 2022

This attempts to fix #11472

Questions:

  • do we need the set_emergency_election_result function when having submit_emergency_solution?
  • @kianenigma what did you mean by highly punished, is the punishment inside the finalize_signed_phase_reject_solution good enough?
  • and also you didn't mention that the correct submission should be rewarded, but I assumed that it is.

This pr is not finished yet, I will need to change the documentation when I am assured that the code inside the submit_emergency_solution is correct. Also, I will probably write tests for it.

polkadot companion: paritytech/polkadot#5795

Polkadot address: 126X27SbhrV19mBFawys3ovkyBS87SGfYwtwa8J2FjHrtbmA

@Szegoo
Copy link
Contributor Author

Szegoo commented Jun 19, 2022

@kianenigma Could you please review this?

@kianenigma
Copy link
Contributor

kianenigma commented Jun 21, 2022

do we need the set_emergency_election_result function when having submit_emergency_solution?

You can explore it, but probably we need both. The old set_emergency_election_result is just a result that's set without checks, while this one is a solution that has to be checked.

@kianenigma what did you mean by highly punished, is the punishment inside the finalize_signed_phase_reject_solution good enough?

Would be good if we make sure that the deposit needed for this is a configurable multiple of the normal signed deposit.

and also you didn't mention that the correct submission should be rewarded, but I assumed that it is.

Indeed!


Once we have some tests, I will take a closer look. So far looks good! 🚀

@kianenigma
Copy link
Contributor

@niklasad1 PTAL, this will need integration in the miner.

@Szegoo
Copy link
Contributor Author

Szegoo commented Jun 21, 2022

I have added two tests and made it possible to configure the multiple of the normal signed deposit. I am not sure why some of these CI checks are failing.

@Szegoo Szegoo requested a review from niklasad1 June 22, 2022 07:50
@Szegoo
Copy link
Contributor Author

Szegoo commented Jun 23, 2022

@kianenigma I have added tests, so I hope you could take a closer look.

@Szegoo
Copy link
Contributor Author

Szegoo commented Jun 25, 2022

@kianenigma @niklasad1 It seems like the CI fails are not caused by the changes made in this PR.

@niklasad1 niklasad1 added A0-please_review Pull request needs code review. B3-apinoteworthy C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Jun 26, 2022
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but would be good with some sharper eyes on this one :)

@Szegoo
Copy link
Contributor Author

Szegoo commented Jul 1, 2022

/tip large

It seems like this didn't work, maybe because I didn't have any dot at that address, which is not the case anymore.

@Szegoo
Copy link
Contributor Author

Szegoo commented Jul 3, 2022

@kianenigma The tip command should probably work now, thanks!

@kianenigma
Copy link
Contributor

/tip large

@substrate-tip-bot
Copy link

A large tip was successfully submitted for Szegoo (126X27SbhrV19mBFawys3ovkyBS87SGfYwtwa8J2FjHrtbmA on polkadot).

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/treasury/tips

@kianenigma
Copy link
Contributor

@Szegoo companions needed.

@Szegoo
Copy link
Contributor Author

Szegoo commented Jul 20, 2022

Does this PR need a companion on Cumulus? I don't see that it is using the pallet I modified, but for some reason, the CI check for it is failing. The error message doesn't seem to be related to this PR. Also, thanks for your patience, I realized just now that I need a companion on Polkadot for this PR and may need one on Cumulus.

cc: @kianenigma @niklasad1

@kianenigma
Copy link
Contributor

unfortunately I am going to have to close this for now, but I will add it to a queue to revisit later. The main reason is that we have received an audit report that allowing arbitrary solutions to be submitted from any origin at the emergency phase could open attack vectors.

One idea is to restrict this so that only a specific origin can submit it, but at that point it becomes really similar to set_emergency_solution.

@Szegoo I checked that you have already been reimbursed for your work here, apologies for the change of plans!

@kianenigma kianenigma closed this Jul 27, 2022
@louismerlin louismerlin removed the D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited label Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders.
Projects
Status: 👀 Might Revisit 👀
Development

Successfully merging this pull request may close these issues.

election-provider: easier recovery from Phase::Emergency
4 participants