Skip to content

Conversation

@amacar
Copy link
Contributor

@amacar amacar commented Oct 23, 2025

Requesting head block with finalized=true sometimes returns block with finalized=false property.
Adding all params to cache key should prevent this.

Maybe you can consider increasing LRU cache a bit, default is only storing 2 items.

Test script which seems to be working fine when including fix from this PR

SAS_SUBSTRATE_URL=wss://rpc-shadow.crust.network/
SAS_EXPRESS_PORT=8070
#!/usr/bin/env bash

set -euo pipefail

while true; do
    nonfinalized=$(curl -s "http://localhost:8070/blocks/head?finalized=false" | jq -r .finalized)
    echo "Finalized block: $nonfinalized"
    finalized=$(curl -s "http://localhost:8070/blocks/head?finalized=true" | jq -r .finalized)

    if [[ "$finalized" == "false" ]]; then
        echo "❌ Error: Block is not finalized!"
        exit 1
    elif [[ "$finalized" == "true" ]]; then
        echo "✅ Block is finalized."
    else
        echo "⚠️ Unexpected response: $finalized"
    fi

    sleep 5s
done

@amacar amacar requested a review from a team as a code owner October 23, 2025 20:36
@cla-bot-2021
Copy link

cla-bot-2021 bot commented Oct 23, 2025

User @amacar, please sign the CLA here.

@amacar amacar force-pushed the fix/add-finalized-key-cache branch from 713d86d to 4a7e349 Compare October 23, 2025 23:01
Copy link
Collaborator

@andrew-ifrita andrew-ifrita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for your contribution.

Let me get 1-2 more pair of eyes to check things out and then we can merge and release, hopefully.

Copy link
Contributor

@filvecchiato filvecchiato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@andrew-ifrita andrew-ifrita merged commit 2c0a2f9 into paritytech:master Oct 24, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants