Skip to content

Rotate the faucet chain automatically.#3893

Merged
afck merged 5 commits intolinera-io:testnet_babbagefrom
afck:testnet_babbage-faucet-rotation
May 6, 2025
Merged

Rotate the faucet chain automatically.#3893
afck merged 5 commits intolinera-io:testnet_babbagefrom
afck:testnet_babbage-faucet-rotation

Conversation

@afck
Copy link
Contributor

@afck afck commented May 6, 2025

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_limit

Release Plan

  • These changes should be deployed on Testnet Babbage.
  • They could be ported to main.

Links

@afck afck requested review from Twey, deuszx, ma2bd and ndr-ds May 6, 2025 09:53
@afck afck marked this pull request as draft May 6, 2025 10:11
@afck afck marked this pull request as ready for review May 6, 2025 14:59
@afck afck merged commit b3b1590 into linera-io:testnet_babbage May 6, 2025
24 checks passed
@afck afck deleted the testnet_babbage-faucet-rotation branch May 6, 2025 15:05
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants