-
Notifications
You must be signed in to change notification settings - Fork 122
feat!(ethexe): malachite #5397
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
Open
grishasobol
wants to merge
75
commits into
master
Choose a base branch
from
gsobol/ethexe/malachite
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat!(ethexe): malachite #5397
Changes from 74 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
2c27c72
initial
grishasobol ab4d2e2
wip(ethexe/malachite): rolling eth_head_history + quarantine anchor
grishasobol 0af3991
refactor(ethexe/malachite): drive quarantine anchor from the shared D…
grishasobol e846cfe
refactor(ethexe/malachite): anchor off the last event-received EB head
grishasobol 1114c38
refactor(ethexe/malachite): validity-window-aware mempool with seen-h…
grishasobol 58a4f96
refactor(ethexe/malachite): switch to secp256k1/ECDSA crypto via gsigner
grishasobol 67ef2f9
fix(ethexe/malachite): stop parent-walks at start_block, tighten memp…
grishasobol 86a431e
append mb computation
grishasobol ba79e8b
feat(ethexe/malachite): independent libp2p key, persistent peers, slo…
grishasobol 7b929d4
test(ethexe/malachite): cover mempool, genesis, libp2p key derivation…
grishasobol 3167e26
refactor(ethexe): replace announce flow with MB-driven coordinator/pa…
grishasobol 1a26a8a
test(ethexe): keep build green during MB refactor
grishasobol 3bd87ec
test(ethexe/consensus): restore batch validation tests on MB flow
grishasobol 3bcf9c5
test(ethexe/consensus): cover aggregate_validators_commitment
grishasobol b59c808
test(ethexe/service): wire malachite into the test harness so ping pa…
grishasobol 1009e33
fix(ethexe/processor): AdvanceTillEthereumBlock walks the full range
grishasobol 09a5e21
feat(ethexe/malachite): synced-flag invariant + lenient producer chai…
grishasobol 32be184
split to service and core
grishasobol 115c328
different fixes
grishasobol f4a7ac2
remove accessing block by height, fix blocks hashing
grishasobol 1b448d8
fix gas_allowance usage
grishasobol d379295
pass whole network restore; fix problems with not synced eth blocks i…
grishasobol 9d1c4d0
remove Announces
grishasobol e315121
return some ethexe-service tests back
grishasobol 095d90c
Merge origin/master, drop Announce-driven diffs
grishasobol fa95b8b
start-local-network.sh fix
grishasobol 575c515
fix(ethexe): wire canonical_quarantine to malachite + drop coordinato…
grishasobol 21c5453
append promise waiting time printing in for injected
grishasobol 8dbe8c8
fix(ethexe/rpc): broadcast injected tx to every validator
grishasobol 4291606
feat(ethexe): wire reply-promise gossip on the producer
grishasobol 155cd5e
test(ethexe/service): restore send_injected_tx; persist injected tx i…
grishasobol bb02ab0
feat(ethexe/compute): stream reply promises mid-MB instead of batching
grishasobol ab0f30b
fix(ethexe/malachite): preserve mempool wakeup permit between fetch a…
grishasobol 0207de8
fix(ethexe/rpc): register promise waiter before broadcasting injected tx
grishasobol 1d4e2aa
test(ethexe/node-loader): add ethexe-ping-rate-load bin for rate-step…
grishasobol aeb2d1b
test(ethexe/scripts): advertise container-DNS public addr per validator
grishasobol a97522d
fix(ethexe/service): tolerate duplicate OutboundAcceptance from RPC f…
grishasobol d178a70
fix(ethexe/malachite): accept injected txs whose ref_block is not yet…
grishasobol 52f5d01
fix(ethexe/malachite): validator waits for chain_head catch-up before…
grishasobol 68c900f
fix(ethexe/consensus): chunk over-sized chain commitments instead of …
grishasobol c17594d
diag(ethexe/consensus): add coordinator/participant lifecycle logging
grishasobol ee518eb
diag(ethexe/network): log every validator-topic message at gossipsub …
grishasobol 543e1bf
fix(ethexe/consensus): is_ancestor_or_equal must walk both directions
grishasobol d0c659a
chore(ethexe): demote consensus diagnostics to debug, drop spam logs
grishasobol 458bfca
refactor(ethexe/consensus): replace is_ancestor_or_equal with mb_meta…
grishasobol 02167df
db(ethexe): bump LATEST_VERSION to 6 for MbMeta schema change
grishasobol 26506ef
refactor(ethexe/consensus): finalized check via globals walk instead …
grishasobol 1036201
remove old compute service
grishasobol 2e4068e
fix problem with tcp listeners
grishasobol d3f2dbf
simplify comments
grishasobol 08ce47e
big refactoring
grishasobol 98df607
more tests adoption
grishasobol 31225bf
chore(ethexe): drop process/legacy comments; reshape MalachiteEvent
grishasobol 215e38c
test(ethexe/service): add wait_till_eth_block_finalized_in_mb helper
grishasobol f4e030a
feat(ethexe/consensus): refuse to commit when latest finalized MB adv…
grishasobol 51a941e
refactor(ethexe/malachite): fold notify_block_synced into receive_new…
grishasobol 67ae197
feat(ethexe): track last_committed_advanced_eth_block in PreparedBloc…
grishasobol 5c13196
test(ethexe/service): switch tests::log::info to test_info!; consolid…
grishasobol 8f903d5
fix(ethexe/service): uninitialized_program — use kick-aware find_map …
grishasobol 1107261
fix(ethexe/service): add stop_nodes cleanup to four leak-prone tests
grishasobol 4857095
ci(nextest): demote ethexe-service leak detection to non-fatal
grishasobol 9af770a
service tests stability
grishasobol 8178e84
fmt
grishasobol 0d638c3
Merge 4cb89523d: feat(ethexe/node-loader): add per-batch watchdog, SI…
grishasobol 8e2e90f
Merge 0a2a578a7: chore(CI): add retry wrappers for network-fragile se…
grishasobol 5aea836
Merge 82ababa05: feat(ethexe): observer alloy chunked event
grishasobol 6cf3ba5
Merge 4138374dd: feat(ethexe): Producer provides only promises hashes
grishasobol a0eb0a2
Merge f5916e263: feat: impl contributing flow & docs
grishasobol 8327cd4
Merge e26caa3b2: fix(ci): Don't use PPA
grishasobol e9a3027
Merge 1951c483f: feat(ethexe-rpc): Metrics middleware for RPC methods
grishasobol 646bac6
Merge 078b9c695: chore: Bump the github-actions group with 14 updates
grishasobol 196326d
Merge b84d725ce: fix(ethexe-network): Partial hashes response in db-sync
grishasobol 2aca596
Merge 7a07b3dd1: chore(ci): Enable recursive submodule checkout in bu…
grishasobol cf3b3a2
append validators changing support
grishasobol 621126e
fix(ci): address CI failures for run 25529077193
grishasobol 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| #!/usr/bin/env bash | ||
| # Stop hook: ask Sonnet to review uncommitted changes against CLAUDE.md | ||
| # at the project root. Exits 2 with findings on stderr if violations are | ||
| # found; exits 0 silently otherwise. Recursion-safe via the | ||
| # CLAUDE_MD_REVIEW_RUNNING env-var guard. | ||
|
|
||
| # Recursion guard: when our own `claude -p` subprocess fires its own Stop, | ||
| # the harness re-invokes this script. We exit immediately in that case. | ||
| if [ -n "${CLAUDE_MD_REVIEW_RUNNING:-}" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| set -uo pipefail | ||
|
|
||
| # Anchor at the git toplevel so the review still fires from any subdir. | ||
| project_root=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0 | ||
| cd "$project_root" | ||
|
|
||
| # Cheap pre-filter — skip the review when no Rust/Solidity/Toml changed. | ||
| # We capture into a variable instead of `grep -q` because pipefail + grep's | ||
| # early-exit makes upstream commands die from SIGPIPE, which would invert | ||
| # the match check. | ||
| changed_files=$( { git diff --name-only HEAD 2>/dev/null; | ||
| git ls-files --others --exclude-standard 2>/dev/null; } ) | ||
| if ! printf '%s\n' "$changed_files" | grep -E '\.(rs|sol|toml)$' >/dev/null; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Build a unified diff covering tracked changes + new file content. | ||
| diff=$(git diff --no-color HEAD 2>/dev/null || true) | ||
| while IFS= read -r f; do | ||
| [ -z "$f" ] && continue | ||
| [ ! -f "$f" ] && continue | ||
| case "$f" in | ||
| *.rs|*.sol|*.toml) ;; | ||
| *) continue ;; | ||
| esac | ||
| diff+=$'\n--- /dev/null\n+++ b/'"$f"$'\n' | ||
| diff+=$(awk '{print "+" $0}' "$f") | ||
| diff+=$'\n' | ||
| done < <(git ls-files --others --exclude-standard 2>/dev/null) | ||
|
|
||
| if [ -z "${diff//[[:space:]]/}" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Dry-run hatch — runs everything except the Sonnet call. For testing. | ||
| if [ -n "${CLAUDE_MD_REVIEW_DRY_RUN:-}" ]; then | ||
| echo "dry-run: $(printf '%s' "$diff" | wc -l) diff lines, would call Sonnet" >&2 | ||
| exit 0 | ||
| fi | ||
|
|
||
| prompt=$(cat <<'PROMPT' | ||
| You are a CLAUDE.md compliance linter for the gear repository. The project | ||
| root is the current working directory. | ||
|
|
||
| 1. Read CLAUDE.md at the project root for the rules. Particularly enforce: | ||
| - Comment & Doc Sizing tiers (Tiny=1 line for inline body comments; | ||
| Small=≤5 for private items; Medium=≤20 for public items; | ||
| Large=≤200 for crate-level) | ||
| - Test timeout cap (no >120_000 ms without explicit user permission) | ||
| - `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` ban in | ||
| production code (tests/mocks excluded) | ||
| - Any other concrete rule stated in CLAUDE.md | ||
|
|
||
| 2. Review the diff below for any rule violations. | ||
|
|
||
| 3. Output format — strict: | ||
| - If NO violations, output the single line `OK` and nothing else. | ||
| - Otherwise, one violation per line as: | ||
| `path:line — rule violated — what to change` | ||
| - No headers, summaries, or commentary outside that format. | ||
|
|
||
| DIFF: | ||
| PROMPT | ||
| ) | ||
| prompt+=$'\n'"$diff" | ||
|
|
||
| # Spawn Sonnet headlessly. Auth inherits from the user's environment. | ||
| # CLAUDE_MD_REVIEW_RUNNING=1 short-circuits this same script when the | ||
| # spawned `claude -p` fires its own Stop event. | ||
| review=$(CLAUDE_MD_REVIEW_RUNNING=1 claude -p "$prompt" \ | ||
| --model sonnet \ | ||
| --output-format text \ | ||
| --max-budget-usd 0.50 \ | ||
| --add-dir "$(pwd)" 2>/dev/null) || exit 0 | ||
|
|
||
| trimmed=$(printf '%s' "$review" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') | ||
|
|
||
| if [ "$trimmed" = "OK" ] || [ -z "$trimmed" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| { | ||
| echo "CLAUDE.md compliance review (Sonnet) — possible issues:" | ||
| echo | ||
| echo "$review" | ||
| echo | ||
| echo "Apply judgment — fix genuine violations of project rules, but skip" | ||
| echo "suggestions that contradict explicit user requests in the current" | ||
| echo "session (e.g. user asked for a verbose comment)." | ||
| } >&2 | ||
| exit 2 | ||
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,18 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/claude-code-settings.json", | ||
| "hooks": { | ||
| "Stop": [ | ||
| { | ||
| "matcher": "", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "bash .claude/hooks/claude-md-review.sh", | ||
| "timeout": 120, | ||
| "statusMessage": "Reviewing changes against CLAUDE.md..." | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of
$(...)command substitution strips all trailing newlines from its command's output. This means that if an untracked file does not end with a newline, this script will incorrectly add one, and if it ends with multiple newlines, they will be stripped. This will produce an incorrect diff forclaudeto review.To correctly preserve trailing newlines, you can use a sentinel character.