-
Notifications
You must be signed in to change notification settings - Fork 2.9k
PoA quorum and HA failover fixes (cherry-pick e1588b6) #3237
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| [advisories] | ||
| ignore = [ | ||
| "RUSTSEC-2025-0009", # https://github.com/FuelLabs/fuel-core/issues/2814 | ||
| ] | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| PoA quorum and HA failover fixes: Redis leader lease adapter improvements, write_block.lua HEIGHT_EXISTS check, sub-quorum block repair, Prometheus metrics, and chaos test harness. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| PoA quorum and HA failover fixes: Redis leader lease adapter improvements, write_block.lua HEIGHT_EXISTS check, sub-quorum block repair, Prometheus metrics, and chaos test harness. |
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,121 @@ | |||||||||||||||||||||||||||||
| name: Leader Lock Chaos Tests | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| workflow_dispatch: | |||||||||||||||||||||||||||||
| inputs: | |||||||||||||||||||||||||||||
| seeds: | |||||||||||||||||||||||||||||
| description: 'Seed range (e.g. "0-100")' | |||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||
| default: '0-50' | |||||||||||||||||||||||||||||
| duration: | |||||||||||||||||||||||||||||
| description: 'Test duration per seed (e.g. "30m")' | |||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||
| default: '30m' | |||||||||||||||||||||||||||||
| block_time: | |||||||||||||||||||||||||||||
| description: 'Block production interval' | |||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||
| default: '100ms' | |||||||||||||||||||||||||||||
| fault_interval: | |||||||||||||||||||||||||||||
| description: 'Average fault injection interval' | |||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||
| default: '1s' | |||||||||||||||||||||||||||||
| stall_threshold: | |||||||||||||||||||||||||||||
| description: 'Max allowed production stall' | |||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||
| default: '20s' | |||||||||||||||||||||||||||||
| parallelism: | |||||||||||||||||||||||||||||
| description: 'Number of seeds per runner' | |||||||||||||||||||||||||||||
| required: false | |||||||||||||||||||||||||||||
| default: '5' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| CARGO_TERM_COLOR: always | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| prepare: | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| outputs: | |||||||||||||||||||||||||||||
| matrix: ${{ steps.matrix.outputs.matrix }} | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - id: matrix | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| RANGE="${{ inputs.seeds }}" | |||||||||||||||||||||||||||||
| START="${RANGE%-*}" | |||||||||||||||||||||||||||||
| END="${RANGE#*-}" | |||||||||||||||||||||||||||||
| BATCH_SIZE=${{ inputs.parallelism }} | |||||||||||||||||||||||||||||
| BATCHES="[" | |||||||||||||||||||||||||||||
| FIRST=true | |||||||||||||||||||||||||||||
| for ((i=START; i<=END; i+=BATCH_SIZE)); do | |||||||||||||||||||||||||||||
| BATCH_END=$((i + BATCH_SIZE - 1)) | |||||||||||||||||||||||||||||
| if [ $BATCH_END -gt $END ]; then BATCH_END=$END; fi | |||||||||||||||||||||||||||||
| if [ "$FIRST" = true ]; then FIRST=false; else BATCHES+=","; fi | |||||||||||||||||||||||||||||
| BATCHES+="{\"start\":$i,\"end\":$BATCH_END}" | |||||||||||||||||||||||||||||
| done | |||||||||||||||||||||||||||||
| BATCHES+="]" | |||||||||||||||||||||||||||||
| echo "matrix={\"batch\":$BATCHES}" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| chaos-test: | |||||||||||||||||||||||||||||
| needs: prepare | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| timeout-minutes: 180 | |||||||||||||||||||||||||||||
| strategy: | |||||||||||||||||||||||||||||
| fail-fast: false | |||||||||||||||||||||||||||||
| matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install Rust toolchain | |||||||||||||||||||||||||||||
| uses: dtolnay/rust-toolchain@stable | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install Redis | |||||||||||||||||||||||||||||
| run: sudo apt-get update && sudo apt-get install -y redis-server | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Cache cargo | |||||||||||||||||||||||||||||
| uses: actions/cache@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| path: | | |||||||||||||||||||||||||||||
| ~/.cargo/registry | |||||||||||||||||||||||||||||
| ~/.cargo/git | |||||||||||||||||||||||||||||
| target | |||||||||||||||||||||||||||||
| key: chaos-test-${{ hashFiles('**/Cargo.lock') }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Build chaos test | |||||||||||||||||||||||||||||
| run: cargo build --release -p fuel-core-chaos-test | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Run chaos tests (seeds ${{ matrix.batch.start }}-${{ matrix.batch.end }}) | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| FAILED=0 | |||||||||||||||||||||||||||||
| for seed in $(seq ${{ matrix.batch.start }} ${{ matrix.batch.end }}); do | |||||||||||||||||||||||||||||
| echo "=== Seed $seed ===" | |||||||||||||||||||||||||||||
| LOG="chaos_seed${seed}.log" | |||||||||||||||||||||||||||||
| cargo run --release -p fuel-core-chaos-test -- \ | |||||||||||||||||||||||||||||
| --seed $seed \ | |||||||||||||||||||||||||||||
| --duration ${{ inputs.duration }} \ | |||||||||||||||||||||||||||||
| --block-time ${{ inputs.block_time }} \ | |||||||||||||||||||||||||||||
| --fault-interval ${{ inputs.fault_interval }} \ | |||||||||||||||||||||||||||||
| --stall-threshold ${{ inputs.stall_threshold }} \ | |||||||||||||||||||||||||||||
| > "$LOG" 2>&1 | |||||||||||||||||||||||||||||
| RC=$? | |||||||||||||||||||||||||||||
| if [ $RC -ne 0 ]; then | |||||||||||||||||||||||||||||
| echo "SEED $seed: FAIL" | |||||||||||||||||||||||||||||
| grep -E "FORK|RESULT" "$LOG" | tail -3 | |||||||||||||||||||||||||||||
| if grep -q "FORK" "$LOG"; then | |||||||||||||||||||||||||||||
| echo "::error::FORK detected at seed $seed" | |||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||
| FAILED=$((FAILED + 1)) | |||||||||||||||||||||||||||||
| else | |||||||||||||||||||||||||||||
| echo "SEED $seed: PASS" | |||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||
| done | |||||||||||||||||||||||||||||
| if [ $FAILED -gt 0 ]; then | |||||||||||||||||||||||||||||
| echo "::error::$FAILED seed(s) failed" | |||||||||||||||||||||||||||||
| exit 1 | |||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chaos test loop exits on first seed failureMedium Severity GitHub Actions runs |
|||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Upload logs | |||||||||||||||||||||||||||||
| if: always() | |||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| name: chaos-logs-${{ matrix.batch.start }}-${{ matrix.batch.end }} | |||||||||||||||||||||||||||||
| path: chaos_seed*.log | |||||||||||||||||||||||||||||
| retention-days: 14 | |||||||||||||||||||||||||||||
|
Comment on lines
+58
to
+121
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI about 2 months ago In general, the fix is to add an explicit The best fix without changing functionality is to add a top-level Concretely, edit permissions:
contents: readafter the
Suggested changeset
1
.github/workflows/chaos-test.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ env: | |
| AWS_ROLE_ARN: arn:aws:iam::024848458133:role/github_oidc_FuelLabs_fuel-core | ||
| AWS_ECR_ORG: fuellabs | ||
| CARGO_TERM_COLOR: always | ||
| RUST_VERSION: 1.93.0 | ||
| RUST_VERSION: 1.90.0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cherry-pick downgrades RUST_VERSION from 1.93.0 to 1.90.0Medium Severity The cherry-pick introduces a |
||
| RUST_VERSION_FMT: nightly-2023-10-29 | ||
| RUST_VERSION_COV: nightly-2024-06-05 | ||
| RUSTFLAGS: -D warnings | ||
|
|
@@ -173,6 +173,7 @@ jobs: | |
| platforms: linux/amd64,linux/arm64 | ||
| build-args: "DEBUG_SYMBOLS=true" | ||
|
|
||
|
|
||
| publish-e2e-client-docker-image: | ||
| needs: | ||
| - publish-docker-images | ||
|
|
||


Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI about 2 months ago
In general, the fix is to add an explicit
permissions:block that restricts the GITHUB_TOKEN to the least privileges necessary. This can be defined either at the workflow root (applies to all jobs) or per job. Since bothprepareandchaos-testonly need to read repository contents (foractions/checkout) and do not push commits, manage issues/PRs, or modify settings,contents: readis sufficient.actions/cacheandactions/upload-artifactdo not require additional repository-scoped write permissions; they use dedicated cache/artifact infrastructure.The best minimal fix without changing functionality is to add a workflow-level
permissions:block right after thename:line (beforeon:). This block should setcontents: read, which is the recommended baseline for read-only workflows. No other scopes appear needed given the provided steps. This will satisfy CodeQL’s requirement, keep the token as least-privilege, and apply consistently to all jobs in this workflow.Concretely:
.github/workflows/chaos-test.yml.1: name: Leader Lock Chaos Tests, insert: