Skip to content

Updated FMD parameters not provided in compact block #4714

Open
@redshiftzero

Description

@redshiftzero

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: a bugneeds-refinementunclear, incomplete, or stub issue that needs work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions