penumbra
penumbra copied to clipboard
Updated FMD parameters not provided in compact block
Describe the bug
When using an algorithm that dynamically changes the FMD parameters, the updated FMD parameters are not provided in the compact block.
To Reproduce Steps to reproduce the behavior:
- Generate configs following the dev net instructions here: https://guide.penumbra.zone/dev/devnet-quickstart.html#generating-configs
- Edit the generated
genesis.json
to ensure you have an allocation to a test wallet and replace the existing key forfmdMetaParams
with:
"fmdMetaParams": {
"fmdGracePeriodBlocks": "360",
"slidingWindow": {
"windowUpdatePeriods": 48,
"targetedDetectionsPerWindow": 500
}
}
- Follow the rest of the devnet set up guide beginning with https://guide.penumbra.zone/dev/devnet-quickstart.html#running-pd
- Run through the first FMD parameter change
- Attempt to send a tx at block 400 or so
Expected behavior You should see the tx succeed
Actual behavior The tx will fail due to the wrong FMD parameters being used:
status: Internal, message: "Error submitting transaction: code 1, log: failed to deliver transaction: check_stateful failed: consensus rule violated: invalid clue precision", details: [], metadata: MetadataMap { headers: {} }
Additional context
Inspecting the pcli view database indicates that the FMD parameters are not being updated (you can verify this periodically through the devnet run after attempting a tx and using select hex(v) from kv where k='fmd_params';
).
Looking at the logic in finalize_compact_block
here:
let fmd_parameters = if height == 0 {
Some(
self.get_current_fmd_parameters()
.await
.context("could not get FMD parameters")?,
)
} else {
None
};
the FMD parameters are only being provided at block height 0