Skip to content

Automatically rotate the faucet chain once it has a maximum length. (#3848)#3852

Merged
afck merged 1 commit intolinera-io:testnet_babbagefrom
afck:testnet_babbage-faucet-rotation
Apr 29, 2025
Merged

Automatically rotate the faucet chain once it has a maximum length. (#3848)#3852
afck merged 1 commit intolinera-io:testnet_babbagefrom
afck:testnet_babbage-faucet-rotation

Conversation

@afck
Copy link
Contributor

@afck afck commented Apr 29, 2025

Backport of #3848.

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.

Test Plan

I extended test_end_to_end_faucet_with_long_chains.

Release Plan

  • These changes should be deployed as the faucet.

Links

…inera-io#3848)

## 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.

## Test Plan

I extended `test_end_to_end_faucet_with_long_chains`.

## Release Plan

- Nothing to do / These changes follow the usual release cycle.
- These changes should be backported to the latest `testnet` branch,
then
    - be deployed as the faucet.

## Links

- Closes linera-io#3846.
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
@afck afck requested review from Twey, christos-h, ma2bd and ndr-ds April 29, 2025 15:01
@afck afck merged commit 026f601 into linera-io:testnet_babbage Apr 29, 2025
24 checks passed
@afck afck deleted the testnet_babbage-faucet-rotation branch April 29, 2025 15:53
afck added a commit that referenced this pull request Apr 30, 2025
## Motivation

As of #3852, the faucet
switches chains every 100 blocks. That means it cannot be restarted with
the same command line, because the original chain may be closed (and
broke).

## Proposal

On restart, while the current chain is closed, keep switching to the
last chain that it opened until we find the most recent one.

Also, change the default maximum length to 500 blocks to reduce the
overhead and the number of chains that end up in the faucet wallet.

## Test Plan

`test_end_to_end_faucet_with_long_chains` restarts the faucet now.

## Release Plan

- These changes should be ported to the `main` branch.
- The faucet should be restarted with this.

## Links

- See #3852.
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
afck added a commit to afck/linera-protocol that referenced this pull request Apr 30, 2025
afck added a commit that referenced this pull request 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

- Closes #3846.
- [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