Skip to content

chore: merge upstream main 2026-06-25#272

Merged
sidhujag merged 17 commits into
mainfrom
merge/upstream-main-2026-06-25
Jun 26, 2026
Merged

chore: merge upstream main 2026-06-25#272
sidhujag merged 17 commits into
mainfrom
merge/upstream-main-2026-06-25

Conversation

@sidhujag

@sidhujag sidhujag commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Merge latest matter-labs/main into Syscoin main through upstream/main.
  • Preserve Syscoin RPC hardening while adopting upstream RateLimits and method filtering.
  • Preserve Syscoin external-node genesis pinning/startup replay seed fixes while adopting upstream main-node retry client changes.
  • Accept upstream consensus integration test removal.

Test plan

  • cargo fmt --all -- --check on remote server with pinned Rust toolchain.
  • Patched Syscoin zksync-os build path on remote server via scripts/gateway-launch/run-os-server-with-patched-zksync-os.sh merge-check-20260625 -- build.
  • Patched clippy on remote server via scripts/gateway-launch/run-os-server-with-patched-zksync-os.sh merge-check-20260625-clippy -- clippy --all-targets --all-features --workspace --exclude zksync_os_integration_tests -- -D warnings.
  • Patched unit tests on remote server via scripts/gateway-launch/run-os-server-with-patched-zksync-os.sh merge-check-20260625-test -- nextest run --workspace --exclude zksync_os_integration_tests.
  • Re-ran remote cargo fmt --all -- --check and patched clippy after RPC batch method-filter hardening.

LogvinovLeon and others added 7 commits June 25, 2026 11:14
…1397)

## Summary

Implements the rate-limit knobs from the [iRaaS Downside Protection
doc](https://app.notion.com/p/matterlabs/iRaas-Downside-Protection-366a48363f23806a9c9bcdee3b212db2).
The doc's tiered shape (global cap, M-bucket shared across listed
methods, per-method overrides) maps directly onto a typed enum on
`RpcConfig`:

```rust
pub enum RateLimits {
    None,
    Tiered { global_rps, m_rps, m_methods, custom_methods },
}
```

Operators set every value via YAML or env vars; default `None` is a
no-op deploy.

- Bin uses smart-config's tagged enum (`#[config(tag = "type")]`), so
env vars flatten:
  ```
  RPC_RATE_LIMITS_TYPE=Tiered
  RPC_RATE_LIMITS_GLOBAL_RPS=1000
  RPC_RATE_LIMITS_M_RPS=200
  RPC_RATE_LIMITS_M_METHODS=eth_call,eth_estimateGas,...
  RPC_RATE_LIMITS_CUSTOM_METHODS=eth_getLogs=200,eth_simulateV1=1,...
  ```
- Internal: middleware switches from `Arc<HashMap<String, RateLimiter>>`
to a typed `Limiter` built from a `Limits` spec.
`RateLimits::into_limits` resolves the enum.
- Drops `RpcRateLimit`, `build_limiters`, and the
`rate_limits_within_global` validator.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…#1396)

## Summary

Add `method_filter: HashSet<String>` on `RpcConfig`. Listed methods get
-32601 \"Method disabled\" + `warn` log before any rate-limit check. New
`MethodFiltering` middleware sits between `Monitoring` and
`RateLimiting`.

- Default empty → deploy is a no-op.
- YAML lists or comma-separated env vars
(`RPC_METHOD_FILTER=eth_newFilter,…`).
- Typical use case: filter the stateful filter family (`eth_newFilter`,
`eth_getFilterChanges`, …) when running behind a load balancer without
sticky sessions.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary

- Remove the `consensus_node` integration test module and its
restarted-node catchup tests.
- Remove the now-unused multi-node consensus test harness and private
fixed-port launcher helper.
- Unlink the consensus test module from the integration test suite.

Validation: `cargo check -p zksync_os_integration_tests --tests`
…startup (matter-labs#1405)

An external node started before its main node panics in
`load_remote_config`,
which k8s turns into `CrashLoopBackOff` — so it picks the main node up
minutes
late instead of seconds.

Now all main-node RPC goes through one `MainNodeClient` that retries
while the
main node is unreachable. Errors the main node **answers** with (e.g. an
old node
missing a method) aren't retried, so the bytecode-supplier fallback
still works.
The EN waits for its main node instead of crashing.

Also: collapse 3 ad-hoc RPC client builds into one; drop a priority-tree
check
already enforced by config validation.

No tests — it's trivial retry/classification logic.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
## Summary

After the migrationNumber was advanced on L1 past the node's cursor, the
binary search done by the l1_watcher started failing because
`migrationNumber` function did not exist pre-v31 in ChainAssetHandler.

This PR properly handles the scenario where the method is missing.

<!--
If your change is *breaking* (semver-major), please UNCOMMENT and fill
out the
sections below. These are required for PRs whose title is marked as
breaking
via conventional commits (e.g. `feat!: ...`, `fix!: ...`).

Make sure that the contents are _actually_ helpful for people who can be
self-hosting
our software.
-->

<!--
## Breaking Changes

- Who is affected? (e.g. protocol in general, EN users, main node)
- What exactly is breaking? (changed DB schema or wiring protocol, added
configs)
- Are there migration steps required for consumers?
- Links to any related docs / migration guides.

## Rollout Instructions

- Order of operations (deploy backend, then clients, etc).
- Monitoring / alerting to watch during rollout.
- Rollback plan (what to revert, how to mitigate if things go wrong).
-->
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a60069b40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1258 to +1260
/// Rate limits for incoming JSON-RPC requests.
#[config(nest)]
pub rate_limits: RpcRateLimitsConfig,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update explorer deploy script for nested rate limits

When DEBUG_RPC_RATE_LIMITS or PUBLIC_RPC_RATE_LIMITS is set, scripts/explorer/blockscout/deploy-zksys-en-rpc.sh still emits the old shape rpc.rate_limits: {method: rps} (see lines 489-494), but this change makes rpc.rate_limits a tagged nested enum that requires type: Tiered with global_rps / m_rps / custom_methods. Those generated configs will no longer deserialize into the intended limits, so the explorer RPC deployment either fails startup or loses the configured protection whenever rate limits are used.

Useful? React with 👍 / 👎.

Comment thread lib/rpc/src/method_filter_middleware.rs Outdated
Comment on lines +68 to +69
let inner = self.inner.clone();
async move { inner.notification(n).await }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Drop filtered JSON-RPC notifications too

For filtered methods sent as JSON-RPC notifications (no id), this path forwards directly to the inner service without checking self.filter, so a disabled stateful method such as eth_newFilter can still execute if the client omits the request id. Since notifications cannot return the -32601 error, the middleware should mirror the rate-limit notification handling and drop matching notifications before calling inner.notification.

Useful? React with 👍 / 👎.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

Copy link
Copy Markdown
Member Author

@codex review Addressed the two prior P2 findings: explorer zksys EN RPC config now emits upstream's tagged Tiered rate-limit shape while preserving legacy method=rps semantics, and method_filter now drops filtered JSON-RPC notifications instead of forwarding them.

jagdeep sidhu and others added 2 commits June 25, 2026 18:40
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cce327b273

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +501 to +502
for method, rps in instance["rate_limits"].items():
rate_lines.append(f" {q(method)}: {rps}")
rate_lines.append(f" {q(method)}: {rps}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve legacy * global rate limits

When PUBLIC_RPC_RATE_LIMITS or DEBUG_RPC_RATE_LIMITS contains a legacy global entry such as *=500, this loop now writes "*" under custom_methods while global_rps remains the unlimited sentinel. RateLimits::into_limits() only treats global_rps as the global bucket, so the generated per-method bucket named * never matches any JSON-RPC method and the public EN silently loses the intended global cap.

Useful? React with 👍 / 👎.

jagdeep sidhu and others added 2 commits June 25, 2026 18:46
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

sidhujag commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

@codex review Addressed the additional rate-limit finding: *=rps in the existing deploy-script env-var input now maps to global_rps, while non-star entries map to custom_methods; the generated node config remains the upstream tagged Tiered shape.

jagdeep sidhu and others added 2 commits June 25, 2026 18:52
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 25a4a15abf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

jagdeep sidhu and others added 3 commits June 25, 2026 19:01
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sidhujag

Copy link
Copy Markdown
Member Author

@codex review Latest head includes only scoped clippy/test cleanup after your no-major-issues review: completed test mock trait method, moved test module to the file bottom, and applied mechanical clippy fixes. Prior rate-limit and notification findings remain addressed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 0982af9946

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sidhujag sidhujag merged commit db86a64 into main Jun 26, 2026
10 of 14 checks passed
@sidhujag

Copy link
Copy Markdown
Member Author

@codex review Addressed Codex Security finding f7086e17c7548191b7af8d25010f655e: now enforces for direct notifications and for notification entries inside JSON-RPC batches by decomposing batches through the same filtered call/notification paths. Remote fmt and patched clippy pass on the latest head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants