Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated FMD parameters not provided in compact block #4714

Open
redshiftzero opened this issue Jul 16, 2024 · 0 comments
Open

Updated FMD parameters not provided in compact block #4714

redshiftzero opened this issue Jul 16, 2024 · 0 comments
Labels
C-bug Category: a bug needs-refinement unclear, incomplete, or stub issue that needs work

Comments

@redshiftzero
Copy link
Member

redshiftzero commented Jul 16, 2024

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 redshiftzero added the C-bug Category: a bug label Jul 16, 2024
@github-actions github-actions bot added the needs-refinement unclear, incomplete, or stub issue that needs work label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: a bug needs-refinement unclear, incomplete, or stub issue that needs work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant