fix: handle optValidatorFaucetCap=0 and add integration test [ci]#4183
Draft
martinflorian-da wants to merge 1 commit intomainfrom
Draft
fix: handle optValidatorFaucetCap=0 and add integration test [ci]#4183martinflorian-da wants to merge 1 commit intomainfrom
martinflorian-da wants to merge 1 commit intomainfrom
Conversation
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>
Contributor
There was a problem hiding this comment.
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
validatorFaucetCapthrough 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. |
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.
Part of #3461
Summary
CIP-0096 will set
optValidatorFaucetCap=0on mainnet (April 30th),disabling validator liveness rewards. This PR ensures the system
operates correctly under that configuration.
Daml bug fix
computeIssuanceTrancheinSplice.Issuancewould hit a division byzero (
DIV_NUMERIC 0.0 0.0) whencapPerCoupon=0andtotalCoupons>0,preventing round closure entirely. Added a guard for
capPerCoupon<=0that returns zero issuance and passes all rewards as unclaimed.
Configurable faucet cap at bootstrap
Threaded a new
validatorFaucetCapparameter through the config stackfollowing the existing
developmentFundPercentagepattern:SpliceUtil.issuanceConfig()/defaultIssuanceCurve()/defaultAmuletConfig()— new parameter with defaultSome(2.85)FoundDsoconfig — newvalidatorFaucetCapfield (None= usedefault 2.85,
Some(0)= zero cap)SV1Initializer— passes config through with.orElse(Some(2.85))ConfigTransforms.withValidatorFaucetCap()— for integration testsTests
testZeroFaucetCap): verifiescomputeIssuingRoundParameterswith zero faucet cap, both with andwithout 5% development fund
ValidatorFaucetCapZeroTimeBasedIntegrationTest):bootstraps with
optValidatorFaucetCap=0, verifies activity recordsare 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