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

Remove sequential increment requirements for Child Bounties #4947

Open
2 tasks done
itsbirdo opened this issue Jul 4, 2024 · 3 comments
Open
2 tasks done

Remove sequential increment requirements for Child Bounties #4947

itsbirdo opened this issue Jul 4, 2024 · 3 comments
Labels
I5-enhancement An additional feature request.

Comments

@itsbirdo
Copy link
Member

itsbirdo commented Jul 4, 2024

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

When you create a child bounty it needs to have a unique ID, which has to be +1 from the last unique ID in the system.
This is fine if there is only one bounty active at a time, but there are many active bounties and we'll see more and more active bounties coming along. This leads to collisions in transactions, resulting in frustration, delays with sending funds to individuals and lost transaction fees.

Example: I create a child bounty, with the id 135, but it takes the signers on the multisig 24h to review and sign the tx.
If another bounty proposes a child bounty with the ID 135 and it gets signed before mine, my transaction will fail. Now imagine this multiplied by many bounties.

As an individual managing a bounty I have had this problem first hand. I know many other bounty managers also struggle with this design decision from how bounties operate.

Request

I would propose to change the way child bounties operate to not use an incrementing ID across all bounties.
Also ensure that child bounties don't need to be sequentially signed based on when they were raised.

Solution

I would propose to move to a user generated GUID, which would reduce collisions to almost zero, however any alternative approach could work.
Another option could be that child bounties need to start with the main bounty number,
e.g. Bounty 37, child bounty 1 (37-1) which is increased sequentially, this results in zero collisions, proving the bounty manager doesn't make a mistake.

Are you willing to help with this request?

Yes!

@itsbirdo itsbirdo added the I5-enhancement An additional feature request. label Jul 4, 2024
@itsbirdo itsbirdo changed the title Introduce GUID for Child Bounties Remove sequential increment requirements for Child Bounties Jul 4, 2024
@ggwpez
Copy link
Member

ggwpez commented Jul 4, 2024

Sorry am not really familiar with the Bounty pallets. Can you post a link maybe to a failed Subscan extrinsic?
Is it the ChildBounties::add_child_bounty call that fails or a different one?

@ggwpez
Copy link
Member

ggwpez commented Jul 5, 2024

Probably its this https://polkadot.statescan.io/#/extrinsics/20813055-2:
Screenshot 2024-07-05 at 15 31 29

They are trying to send two calls in a batch and just guessing the childBountyId. So sure it can be wrong if another addChildBounty call came first. Could be solved by attaching a curator proposal directly to the add_child_bounty call.

Another way would be to add a custom XCM instruction (probably controversial), since you basically want to get the "return value" of the first call as argument for the second one.

@itsbirdo
Copy link
Member Author

itsbirdo commented Jul 9, 2024

It doesn't matter if you try to send two calls in one batch. Please review the use case, this will still happen if you are proposing just one transaction in a child bounty, batch or no batch.

Example: I create a child bounty, with the id 135, but it takes the signers on the multisig 24h to review and sign the tx.
If another bounty proposes a child bounty with the ID 135 and it gets signed before mine, my transaction will fail.

This is why the number needs to be a guid (or something else) and not a sequential increasing number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

2 participants