Rotate the faucet chain automatically.#3893
Merged
afck merged 5 commits intolinera-io:testnet_babbagefrom May 6, 2025
Merged
Conversation
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
reviewed
May 6, 2025
deuszx
approved these changes
May 6, 2025
afck
added a commit
that referenced
this pull request
May 7, 2025
## Motivation It should be possible to e.g. define a `const x: Amount` using some addition and multiplication. (I ran into this in #3893.) ## Proposal Make more functions `const`. (Also fix a typo.) ## Test Plan N/A ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
If the faucet chain gets very long, requesting a new chain becomes very slow for new wallets.
Proposal
Make the faucet switch chains every 100 blocks.
The previous attempt was reverted: #3852
This new approach makes it less problematic to restart the faucet:
The faucet now only uses the main chain (which in practice will usually be one of our root chains in the testnet) to create temporary child chains. It only provides each child with enough funds to serve 100 user requests. (That number is a config option.) Once the child's funds are exhausted, it is closed and removed from the wallet, and a new child is created from the main chain.
In particular, the main chain is never drained of all funds at once, it never gets closed, and it is never used to directly serve user requests. All chains requested by users are grandchildren of the main chain, because they are created by one of the temporary chains. Since these are never longer than 100 blocks, synchronization for new users should be much faster.
Test Plan
test_end_to_end_faucet_chain_limitRelease Plan
main.Links