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

Tests to ensure create bounty actually works #673

Closed
xlc opened this issue Apr 6, 2023 · 7 comments
Closed

Tests to ensure create bounty actually works #673

xlc opened this issue Apr 6, 2023 · 7 comments
Labels
T10-tests This PR/Issue is related to tests.

Comments

@xlc
Copy link
Contributor

xlc commented Apr 6, 2023

There was bad config breaks the ability for root and council to create bounty. No one caught that. That means we need more tests.

@bkchr
Copy link
Member

bkchr commented Apr 6, 2023

Cc @s3krit

@s3krit
Copy link

s3krit commented Apr 6, 2023

Is there a fix for this already merged? If so, when was the first and last known-bad commits?

@xlc
Copy link
Contributor Author

xlc commented Apr 6, 2023

https://github.com/paritytech/polkadot/blob/645723987cf9662244be8faf4e9b63e8b9a1b3a3/runtime/polkadot/src/lib.rs#L859 is the bad config in v0.9.37. Use blame to find the previous commit without this.
I don't know if it is fixed on master but the OpenGov code changed the config again. You will find it out with some tests.

@bkchr bkchr added the I5-tests label Apr 9, 2023
@s3krit
Copy link

s3krit commented Apr 12, 2023

I'm pretty sure I'm misunderstanding this issue. As per the bounties pallet in substrate, 'The dispatch origin for this call must be Signed.':

https://github.com/paritytech/substrate/blob/master/frame/bounties/src/lib.rs#L324

and sure enough, modifying the test to use RuntimeOrigin::root() causes the propose_bounty_works test to fail with BadOrigin. Which sounds to me like it was never intended to be able to propose a bounty as root. That being said, I also spun up kusama and polkadot dev chains and used chopsticks to insert Alice into the council and attempted to propose & execute a bounty, which also fails with BadOrigin, despite Kusama and Polkadot now using type SpendOrigin = TreasurySpender; (which is EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>;), which confirms the behaviour you described.

Please let me know if I've missed something or just completely misunderstood :) Either way, I've written a little e2e regression test using zombienet to test the bounties implementation in polkadot, which I'll add to my set of regression tests. I'm guessing we'd also want a unit test adding to either the bounties pallet itself, or polkadot/kusama's tests

@bkchr
Copy link
Member

bkchr commented Apr 12, 2023

despite Kusama and Polkadot now using type SpendOrigin = TreasurySpender; (which is EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>;), which confirms the behaviour you described.

Council is not a root origin, so you will need to change this to the correct origin.

@Sophia-Gold Sophia-Gold transferred this issue from paritytech/polkadot Aug 24, 2023
@the-right-joyce the-right-joyce added T10-tests This PR/Issue is related to tests. and removed I5-tests labels Aug 25, 2023
claravanstaden added a commit to Snowfork/polkadot-sdk that referenced this issue Dec 8, 2023
* Adds Georli network to hardhat.

* Updates Lodestar endpoints used for Lodestar 1.0.0.

* Updates readme and lodestar run parameters.

* Uncomment deploy contracts

* Upgrades for new geth version.

* Fixes spelling in start-services. Updates README

Co-authored-by: claravanstaden <Cats 4 life!>
@shawntabrizi
Copy link
Member

@the-right-joyce should be marked as easy and good first issue please

@bkchr
Copy link
Member

bkchr commented Mar 11, 2024

The issue does not belong here anymore. I created a new one: polkadot-fellows/runtimes#232

@bkchr bkchr closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T10-tests This PR/Issue is related to tests.
Projects
None yet
Development

No branches or pull requests

5 participants