Skip to content

Commit 39eabbb

Browse files
authored
Merge branch 'megaeth-labs:main' into main
2 parents 32e509e + 350e26c commit 39eabbb

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
additional_permissions: |
7878
actions: read
7979
claude_args: |
80-
--allowedTools "Read,Glob,Grep,mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr checks:*),Bash(gh label list:*),Bash(gh run view:*),Bash(gh run list:*),Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(git blame:*),Bash(git status:*),Bash(ls:*),Bash(tree:*)"
80+
--allowedTools "Read,Glob,Grep,mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr checks:*),Bash(gh label list:*),Bash(gh run view:*),Bash(gh run list:*),Bash(gh api:*),Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(git blame:*),Bash(git status:*),Bash(ls:*),Bash(tree:*)"
8181
prompt: |
8282
REPO: ${{ github.repository }}
8383
PR NUMBER: ${{ github.event.pull_request.number }}

REVIEW.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
- No high-cardinality labels (no tx hashes or addresses as label values)
2020
- Prometheus naming conventions: `snake_case` with unit suffixes (`_seconds`, `_bytes`, `_total`)
2121

22+
## Previous comments
23+
24+
- Before writing new comments, check all previous review threads on this PR
25+
- If a previous comment has been addressed by the latest changes, resolve that thread using:
26+
`gh api graphql -f query='mutation { resolveReviewThread(input:{threadId:"THREAD_ID"}) { thread { id } } }'`
27+
- To find thread IDs, query:
28+
`gh api graphql -f query='{ repository(owner:"OWNER", name:"REPO") { pullRequest(number:NUMBER) { reviewThreads(first:50) { nodes { id isResolved comments(first:1) { nodes { body path } } } } } } }'`
29+
- Do not repeat feedback that has already been addressed
30+
2231
## Skip
2332

2433
- Formatting-only changes already enforced by `cargo fmt`

bin/stateless-validator/src/metrics.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub fn init_metrics(addr: SocketAddr) -> Result<()> {
9797
.map_err(|e| eyre::eyre!("Failed to install Prometheus exporter: {}", e))?;
9898

9999
register_metric_descriptions();
100+
init_rpc_method_counters();
100101
info!("[Metrics] Prometheus exporter listening on {}", addr);
101102
Ok(())
102103
}
@@ -145,6 +146,24 @@ fn register_metric_descriptions() {
145146
describe_histogram!(names::SALT_WITNESS_KVS_SIZE, "Salt witness KVs size (bytes)");
146147
}
147148

149+
/// Pre-register RPC method counters used by the validator so they appear in Prometheus output from
150+
/// startup.
151+
fn init_rpc_method_counters() {
152+
let methods = [
153+
RpcMethod::EthGetCodeByHash,
154+
RpcMethod::EthGetBlockByNumber,
155+
RpcMethod::EthBlockNumber,
156+
RpcMethod::EthGetHeader,
157+
RpcMethod::MegaGetBlockWitness,
158+
RpcMethod::MegaSetValidatedBlocks,
159+
];
160+
for method in methods {
161+
let method_str = method.as_str();
162+
counter!(names::RPC_REQUESTS_TOTAL, "method" => method_str).increment(0);
163+
counter!(names::RPC_ERRORS_TOTAL, "method" => method_str).increment(0);
164+
}
165+
}
166+
148167
/// Record validation timing and block statistics after successful validation.
149168
#[allow(clippy::too_many_arguments)]
150169
pub fn on_validation_success(

0 commit comments

Comments
 (0)