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

feat: bad blocks chain extension #479

Merged
merged 2 commits into from
May 29, 2024
Merged

feat: bad blocks chain extension #479

merged 2 commits into from
May 29, 2024

Conversation

orriin
Copy link
Contributor

@orriin orriin commented May 27, 2024

Closes #467

  • Improves chain spec logic organisation
  • Adds option to specify bad_blocks in chain specs

Tested:

Screenshot 2024-05-27 at 08 32 05

Node will log attempts to import bad blocks a few times before banning the peer trying to propagate the bad block.

feat: chain extensions
@orriin orriin added the blue team defensive programming, CI, etc label May 27, 2024
@distributedstatemachine
Copy link
Contributor

distributedstatemachine commented May 27, 2024

Nice ! @orriin can you please add instructions to test this ? It be also be helpful to try using this to sync an archive node on finney

Node will log attempts to import bad blocks a few times before banning the peer trying to propagate the bad block.

What happens if all the peers have the badblocks? Does this mean it wont be able to sync as it is banning a peers?

@@ -8,7 +8,7 @@ BASE_DIR="$SCRIPT_DIR/.."

: "${CHAIN:=local}"
: "${BUILD_BINARY:=1}"
: "${FEATURES:=pow-faucet}"
: "${FEATURES:="pow-faucet runtime-benchmarks"}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the runtime-benchmarks for localnet ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it didn't work, got the same error that you DM'd me about

@orriin
Copy link
Contributor Author

orriin commented May 27, 2024

Nice ! @orriin can you please add instructions to test this ? It be also be helpful to try using this to sync an archive node on finney

  1. Sync Alice and Bob some blocks
  2. Stop Bob
  3. Add latest block hash to bad blocks
  4. Regen chain spec
  5. Start Alice again

What happens if all the peers have the badblocks? Does this mean it wont be able to sync as it is banning a peers?

Yeah, it can't sync from them anyway because they have bad blocks. Dw though, the ban list is cleared when the node restarts.

@distributedstatemachine
Copy link
Contributor

@orriin please resolve conflicts

@orriin orriin merged commit 255d867 into development May 29, 2024
10 of 11 checks passed
@orriin orriin deleted the feat/chain-extension branch May 29, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blue team defensive programming, CI, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bad_blocks chain extension
2 participants