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

Crowdloan not participating in Auction #479

Closed
SBalaguer opened this issue Jul 8, 2023 · 4 comments
Closed

Crowdloan not participating in Auction #479

SBalaguer opened this issue Jul 8, 2023 · 4 comments
Labels
I2-bug The node fails to follow expected behavior.

Comments

@SBalaguer
Copy link
Contributor

Context

Auction paritytech/polkadot#45 started on Polkadot at block 16_291_326. At that moment in time, two crowdloans were running: paraID 3338 and paraID3340. Both crowloands had an ending_block that was smaller than the Last Block of Auction 45, however greater than the start of the ending_period for Auction 45.

The moment that start_period of Auction 45 started, paraID's 3338 Crowdloan managed to place a bid. Noteworthy, all the blocks in start_period of any auction do not count to the actual candle stick auction mechanism.

image

The Issue

At block 16_2913_26 the ending_period of Auction 45 started, however none of the active crowdloans could place a bid. The action of placing a bid for both crowdloans would error out with ConsumerRemaining, as can be seen here for paraID 3340 and here for paraID 3338.

It is my understanding (but this could be wrong), that this Event is being triggered from the on_initialize function from the Crowdloan Pallet.

After this, several attempts were made by contributors to contribute to the crowdloan to see if that could potentially nudge something and make the crowdloan bid. None of them were successful until:

Expected Behavior

The expected behavior was for the crowdloans to participate on the auction the moment the ending_period of the auction started.

After the nudge stated before, both crowdloans managed to place a bid and are competing in the auction.

Related links

The following are some functions identified while trying to understand the issue.

@ggwpez
Copy link
Member

ggwpez commented Jul 8, 2023

For reference; the manual ED transfers were in block 16,308,353 (inv arch) and 16,308,374 (Peaq).
We can check that after the auction is over, if both accounts have 1.1 DOT left then it is probably some behavioural change from paritytech/substrate#12951 that was not yet integrated into the crowdloans pallet.

PS: Looking at the events, the ED transfers are in the block range where it started working again.
Failed in: 16,306,584, and worked again in 16,308,776.
image

@SBalaguer
Copy link
Contributor Author

@ggwpez I think this makes a lot of sense. After you put the ED on place, then the contribution nudged the crowdloan pallet to check if it was the highest bid and the crowdloan effectively bid on the auction.

If this is the case, then we need to look into it relatively fast. Otherwise, other crowdloans that can arise for the next batch of auction (starting in ~25 days) will face the same issue.

@juangirini juangirini transferred this issue from paritytech/polkadot Aug 24, 2023
@the-right-joyce the-right-joyce added I2-bug The node fails to follow expected behavior. and removed I3-bug labels Aug 25, 2023
@kianenigma
Copy link
Contributor

placing the bid will eventually lead to a problematic line of code that will attempt to reserve all of the free balance in the crowdloan account. This was acceptable prior to paritytech/substrate#12951 and no longer is.

The fix, as the PR says, should be to increment the providers of any crowdloan account (assuming some sort of deposit is taken).

For example, this is the account of CL66 before and after their first successful bid.

Screenshot 2023-09-06 at 18 31 13

If this is the correct patch, more important than the patch itself is to see why no unit tests in this pallet caught the issue, and make sure one is added.

As a bonus, you can then look at the other pallets using ReservableCurrency and making sure they have a similar-ish test.

@gupnik
Copy link
Contributor

gupnik commented Sep 12, 2023

I was able to setup a UT that reproduces this issue and it only happened if we were not incrementing the providers while creating the crowdloan. In the crowdloans that caused the issue, we could see only 1 provider before the bid which would make it fail when the entire amount is tried to be reserved.

However, the new ones already had 2 providers. So, it seems that the previous crowdloans were created before the change went live (and hence did not have the increment of the providers at creation).

new

More info around the dates confirming that erroneous crowdloan was indeed created before the release:

  • The erroneous crowdloan was created here:
1 2
  • The code got updated here:
3

@gupnik gupnik closed this as completed Sep 12, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Runtime / FRAME Sep 12, 2023
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
* parse substrate message proof

* unfinalized_header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior.
Projects
Status: Done
Development

No branches or pull requests

5 participants