penumbra icon indicating copy to clipboard operation
penumbra copied to clipboard

Updated FMD parameters not provided in compact block

Open redshiftzero opened this issue 7 months ago • 0 comments

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:

  1. Generate configs following the dev net instructions here: https://guide.penumbra.zone/dev/devnet-quickstart.html#generating-configs
  2. Edit the generated genesis.json to ensure you have an allocation to a test wallet and replace the existing key for fmdMetaParams with:
"fmdMetaParams": {
            "fmdGracePeriodBlocks": "360",
            "slidingWindow": {
                "windowUpdatePeriods": 48,
                "targetedDetectionsPerWindow": 500
            }
        }
  1. Follow the rest of the devnet set up guide beginning with https://guide.penumbra.zone/dev/devnet-quickstart.html#running-pd
  2. Run through the first FMD parameter change
  3. 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

redshiftzero avatar Jul 16 '24 23:07 redshiftzero