Skip to content

fix: handle optValidatorFaucetCap=0 and add integration test [ci]#4183

Draft
martinflorian-da wants to merge 1 commit intomainfrom
martinflorian-da/validator-faucet-cap-zero-test/3461
Draft

fix: handle optValidatorFaucetCap=0 and add integration test [ci]#4183
martinflorian-da wants to merge 1 commit intomainfrom
martinflorian-da/validator-faucet-cap-zero-test/3461

Conversation

@martinflorian-da
Copy link
Contributor

Part of #3461

Note: This PR was created as part of an experiment with LLM agents
(Claude Code). Please ignore for now — not requesting review.

Summary

CIP-0096 will set optValidatorFaucetCap=0 on mainnet (April 30th),
disabling validator liveness rewards. This PR ensures the system
operates correctly under that configuration.

Daml bug fix

computeIssuanceTranche in Splice.Issuance would hit a division by
zero (DIV_NUMERIC 0.0 0.0) when capPerCoupon=0 and totalCoupons>0,
preventing round closure entirely. Added a guard for capPerCoupon<=0
that returns zero issuance and passes all rewards as unclaimed.

Configurable faucet cap at bootstrap

Threaded a new validatorFaucetCap parameter through the config stack
following the existing developmentFundPercentage pattern:

  • SpliceUtil.issuanceConfig() / defaultIssuanceCurve() /
    defaultAmuletConfig() — new parameter with default Some(2.85)
  • FoundDso config — new validatorFaucetCap field (None = use
    default 2.85, Some(0) = zero cap)
  • SV1Initializer — passes config through with .orElse(Some(2.85))
  • ConfigTransforms.withValidatorFaucetCap() — for integration tests

Tests

  • Daml unit test (testZeroFaucetCap): verifies
    computeIssuingRoundParameters with zero faucet cap, both with and
    without 5% development fund
  • Integration test (ValidatorFaucetCapZeroTimeBasedIntegrationTest):
    bootstraps with optValidatorFaucetCap=0, verifies activity records
    are still created, issuing rounds have zero faucet issuance, and
    rounds continue advancing without errors

Signed-off-by: Martin Florian martin.florian@digitalasset.com
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Part of #3461

> **Note:** This PR was created as part of an experiment with LLM agents
> (Claude Code). Please ignore for now — not requesting review.

## Summary

CIP-0096 will set `optValidatorFaucetCap=0` on mainnet (April 30th),
disabling validator liveness rewards. This PR ensures the system
operates correctly under that configuration.

### Daml bug fix

`computeIssuanceTranche` in `Splice.Issuance` would hit a division by
zero (`DIV_NUMERIC 0.0 0.0`) when `capPerCoupon=0` and `totalCoupons>0`,
preventing round closure entirely. Added a guard for `capPerCoupon<=0`
that returns zero issuance and passes all rewards as unclaimed.

### Configurable faucet cap at bootstrap

Threaded a new `validatorFaucetCap` parameter through the config stack
following the existing `developmentFundPercentage` pattern:

- `SpliceUtil.issuanceConfig()` / `defaultIssuanceCurve()` /
  `defaultAmuletConfig()` — new parameter with default `Some(2.85)`
- `FoundDso` config — new `validatorFaucetCap` field (`None` = use
  default 2.85, `Some(0)` = zero cap)
- `SV1Initializer` — passes config through with `.orElse(Some(2.85))`
- `ConfigTransforms.withValidatorFaucetCap()` — for integration tests

### Tests

- **Daml unit test** (`testZeroFaucetCap`): verifies
  `computeIssuingRoundParameters` with zero faucet cap, both with and
  without 5% development fund
- **Integration test** (`ValidatorFaucetCapZeroTimeBasedIntegrationTest`):
  bootstraps with `optValidatorFaucetCap=0`, verifies activity records
  are still created, issuing rounds have zero faucet issuance, and
  rounds continue advancing without errors

Signed-off-by: Martin Florian <martin.florian@digitalasset.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates issuance logic and configuration plumbing to correctly support optValidatorFaucetCap=0 (CIP-0096), preventing round-closure failures when validator liveness rewards are disabled, and adds automated coverage for that configuration.

Changes:

  • Fix Daml issuance computation to avoid division-by-zero when capPerCoupon <= 0.
  • Thread a configurable validatorFaucetCap through SV bootstrap/config and shared config helpers.
  • Add a Daml unit test and a time-based integration test; bump affected Daml package versions and lock entries.

Reviewed changes

Copilot reviewed 22 out of 30 changed files in this pull request and generated no comments.

Show a summary per file
File Description
token-standard/splice-token-standard-test/daml.yaml Bumps DAR version for token-standard test package.
test-full-class-names-sim-time.log Registers the new sim-time integration test in CI’s test list.
daml/splitwell/daml.yaml Bumps splitwell DAR version.
daml/splitwell-test/daml.yaml Bumps splitwell-test DAR version.
daml/splice-wallet/daml.yaml Bumps splice-wallet DAR version.
daml/splice-wallet-test/daml.yaml Bumps splice-wallet-test DAR version.
daml/splice-wallet-payments/daml.yaml Bumps splice-wallet-payments DAR version.
daml/splice-util-token-standard-wallet-test/daml.yaml Bumps splice-util-token-standard-wallet-test DAR version.
daml/splice-util-featured-app-proxies-test/daml.yaml Bumps splice-util-featured-app-proxies-test DAR version.
daml/splice-util-batched-markers-test/daml.yaml Bumps splice-util-batched-markers-test DAR version.
daml/splice-dso-governance/daml.yaml Bumps splice-dso-governance DAR version.
daml/splice-dso-governance-test/daml.yaml Bumps splice-dso-governance-test DAR version.
daml/splice-amulet/daml/Splice/Issuance.daml Guards computeIssuanceTranche for capPerCoupon <= 0 to avoid division-by-zero.
daml/splice-amulet/daml.yaml Bumps splice-amulet DAR version.
daml/splice-amulet-test/daml/Splice/Scripts/UnitTests/Issuance.daml Adds a unit test covering zero faucet cap issuance behavior.
daml/splice-amulet-test/daml.yaml Bumps splice-amulet-test DAR version.
daml/splice-amulet-name-service/daml.yaml Bumps splice-amulet-name-service DAR version.
daml/splice-amulet-name-service-test/daml.yaml Bumps splice-amulet-name-service-test DAR version.
daml/dars.lock Updates DAR lock entries for all version bumps.
apps/sv/src/main/scala/org/lfdecentralizedtrust/splice/sv/onboarding/sv1/SV1Initializer.scala Passes validatorFaucetCap into bootstrap amulet config construction.
apps/sv/src/main/scala/org/lfdecentralizedtrust/splice/sv/config/SvAppConfig.scala Adds validatorFaucetCap to SvOnboardingConfig.FoundDso.
apps/common/src/main/scala/org/lfdecentralizedtrust/splice/util/SpliceUtil.scala Adds validatorFaucetCap plumbing to issuance/amulet config helpers.
apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/ValidatorFaucetCapZeroTimeBasedIntegrationTest.scala Adds integration test ensuring the system progresses with faucet cap set to 0.
apps/app/src/main/scala/org/lfdecentralizedtrust/splice/config/ConfigTransforms.scala Adds withValidatorFaucetCap config transform for tests.

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