-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance node functionality with BIP support and sync improvements #2
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
Merged
+5,645
−471
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
792a12d
chore(gitignore): ignore default node data dir
metaphorics 1c0c9e5
feat(node): bootstrap peers through bounded admission
metaphorics be9267d
chore(p2p): bump version to 0.1.1 for SystemDnsResolver API
metaphorics 0849aea
feat(rpc): scan addr utxos via scantxoutset
metaphorics fc79174
fix(node): keep applied sync tip contiguous
metaphorics 9e434d2
fix(node): buffer out-of-order sync blocks
metaphorics d4673ee
fix(consensus): encode BIP34 heights like Core
metaphorics edfd149
test(consensus): pin signet BIP34 height-one bytes
metaphorics 733c14c
fix(consensus): remove unreachable kernel network fallback
metaphorics fc688a3
fix(node): wire mdbx feature through runtime indexes
metaphorics a6b78ec
test(gates): enforce G14 evidence budgets
metaphorics 8c6213f
test(node): cover contextual nBits rejection
metaphorics 21aa952
test(rpc): pin empty muhash oracle
metaphorics f65c593
test(gates): enforce G2 muhash evidence
metaphorics 1176cd6
test(node): assert sync coinstats plumbing
metaphorics 33408cd
test(coinstats): cover muhash removal trailer
metaphorics 314046e
test(node): cover apply spend coinstats
metaphorics 40f8f61
feat(node): emit G2 muhash samples
metaphorics 80b8d12
feat(gates): collect Core G2 muhash samples
metaphorics e461d94
fix(node): narrow mdbx feature forwarding
metaphorics 7225f97
fix(node): create data dir before G2 sampler
metaphorics 1adcfc4
fix(node): validate same-block UTXO spends
metaphorics a9681bd
fix(consensus): enforce coinbase scriptsig size
metaphorics 45facf7
fix(p2p): reject oversized headers messages
metaphorics ef89f30
fix(node): restore coinbase overlay visibility
metaphorics 461396a
fix(consensus): reject merkle-mutated blocks
metaphorics 1429493
fix(p2p): reject oversized inventory vectors
metaphorics 0cfa321
fix(p2p): reject oversized getblocks locators
metaphorics f1d85bd
fix(p2p): reject oversized locator payloads
metaphorics 331c7a5
fix(p2p): reject oversized address messages
metaphorics 57f3a58
fix(node): skip invalid BIP158 filter rows
metaphorics fd10227
fix(p2p): track sendcmpct negotiation
metaphorics 6082045
fix(node): preserve getdata retry after send failure
metaphorics 5fea2b4
fix: address PR review comments
metaphorics 53fa4ed
fix(node): forward mdbx storage feature
metaphorics 4ef4007
fix(rpc): require scantxoutset scanobjects
metaphorics ff754c9
chore(deps): drop unused skiplist workspace dep
metaphorics 39aa8c1
fix(node): remove compile_error! that breaks fresh virtual-workspace …
Copilot 1016336
fix(utxo): preserve high-vout records
metaphorics 1ddf203
test(script): gate consensus proptest helpers
metaphorics db680b3
fix(node): exclude genesis coinbase from live UTXO state
metaphorics 751968c
test(utxo): remove infallible snapshot result
metaphorics d5c01f6
fix(utxo): notify listeners on duplicate output overwrite
metaphorics File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| //! Smoke tests for the G2 Bitcoin Core `MuHash` collection helper. | ||
| #![cfg(unix)] | ||
|
|
||
| use std::fs; | ||
| use std::os::unix::fs::PermissionsExt as _; | ||
| use std::path::{Path, PathBuf}; | ||
| use std::process::Command; | ||
|
|
||
| #[test] | ||
| fn script_prints_required_g2_heights() -> Result<(), Box<dyn std::error::Error>> { | ||
| let output = Command::new("bash") | ||
| .arg(script_path()) | ||
| .args(["--print-heights", "20001"]) | ||
| .output()?; | ||
|
|
||
| assert_success(&output); | ||
| assert_eq!( | ||
| String::from_utf8(output.stdout)?, | ||
| "0\n10000\n20000\n20001\n" | ||
| ); | ||
| Ok(()) | ||
| } | ||
|
|
||
| #[test] | ||
| fn script_normalizes_bitcoind_muhash_responses() -> Result<(), Box<dyn std::error::Error>> { | ||
| let temp = tempfile::tempdir()?; | ||
| let bitcoin_cli = fake_bitcoin_cli(temp.path(), false)?; | ||
| let output = Command::new("bash") | ||
| .arg(script_path()) | ||
| .arg("20001") | ||
| .env("BITCOIN_CLI", bitcoin_cli) | ||
| .output()?; | ||
|
|
||
| assert_success(&output); | ||
| assert_eq!( | ||
| String::from_utf8(output.stdout)?, | ||
| expected_samples([0, 10_000, 20_000, 20_001]) | ||
| ); | ||
| Ok(()) | ||
| } | ||
|
|
||
| #[test] | ||
| fn script_rejects_bitcoind_height_mismatch() -> Result<(), Box<dyn std::error::Error>> { | ||
| let temp = tempfile::tempdir()?; | ||
| let bitcoin_cli = fake_bitcoin_cli(temp.path(), true)?; | ||
| let output = Command::new("bash") | ||
| .arg(script_path()) | ||
| .arg("1") | ||
| .env("BITCOIN_CLI", bitcoin_cli) | ||
| .output()?; | ||
|
|
||
| assert!(!output.status.success()); | ||
| assert!(String::from_utf8_lossy(&output.stderr).contains("expected 0")); | ||
| Ok(()) | ||
| } | ||
|
|
||
| fn script_path() -> PathBuf { | ||
| Path::new(env!("CARGO_MANIFEST_DIR")) | ||
| .join("../../scripts/collect-g2-bitcoind-muhash-samples.sh") | ||
| } | ||
|
|
||
| fn fake_bitcoin_cli(dir: &Path, wrong_height: bool) -> Result<PathBuf, Box<dyn std::error::Error>> { | ||
| let path = dir.join("bitcoin-cli"); | ||
| let height_expr = if wrong_height { "height + 1" } else { "height" }; | ||
| fs::write( | ||
| &path, | ||
| format!( | ||
| r#"#!/usr/bin/env python3 | ||
| import json | ||
| import sys | ||
|
|
||
| if len(sys.argv) != 5 or sys.argv[1] != "gettxoutsetinfo" or sys.argv[2] != "muhash" or sys.argv[4] != "true": | ||
| raise SystemExit(f"unexpected arguments: {{sys.argv[1:]!r}}") | ||
|
|
||
| height = int(sys.argv[3]) | ||
| print(json.dumps({{"height": {height_expr}, "muhash": f"{{height:064x}}"}})) | ||
| "#, | ||
| ), | ||
| )?; | ||
| let mut permissions = fs::metadata(&path)?.permissions(); | ||
| permissions.set_mode(0o755); | ||
| fs::set_permissions(&path, permissions)?; | ||
| Ok(path) | ||
| } | ||
|
|
||
| fn expected_samples<const N: usize>(heights: [u32; N]) -> String { | ||
| let body = heights | ||
| .into_iter() | ||
| .map(|height| format!("{height}:{height:064x}")) | ||
| .collect::<Vec<_>>() | ||
| .join(","); | ||
| format!("{body}\n") | ||
| } | ||
|
|
||
| fn assert_success(output: &std::process::Output) { | ||
| assert!( | ||
| output.status.success(), | ||
| "script failed: {}", | ||
| String::from_utf8_lossy(&output.stderr) | ||
| ); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.