Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
- Introduce `SyncChainMmr` RPC endpoint to sync chain MMR deltas within specified block ranges ([#1591](https://github.com/0xMiden/node/issues/1591)).
- Fixed `TransactionHeader` serialization for row insertion on database & fixed transaction cursor on retrievals ([#1701](https://github.com/0xMiden/node/issues/1701)).
- Added KMS signing support in validator ([#1677](https://github.com/0xMiden/node/pull/1677)).
- Added per-IP gRPC rate limiting across services as well as global concurrent connection limit ([#1746](https://github.com/0xMiden/node/issues/1746), [#1865](https://github.com/0xMiden/node/pull/1865)).
- Added finality field for `SyncChainMmr` requests ([#1725](https://github.com/0xMiden/miden-node/pull/1725)).
- Added per-IP gRPC rate limiting across services as well as global concurrent connection limit ([#1746](https://github.com/0xMiden/node/issues/1746)).
- Added limit to execution cycles for a transaction network, configurable through CLI args (`--ntx-builder.max-tx-cycles`) ([#1801](https://github.com/0xMiden/node/issues/1801)).
- Added monitor version and network name to the network monitor dashboard, network name is configurable via `--network-name` / `MIDEN_MONITOR_NETWORK_NAME` ([#1838](https://github.com/0xMiden/node/pull/1838)).

Expand Down
9 changes: 5 additions & 4 deletions crates/rpc/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,20 @@ impl Rpc {
.make_span_with(grpc_trace_fn),
)
.layer(HealthCheckLayer)
.layer(cors_for_grpc_web_layer())
// Note: must wrap the accept/rate-limit layers so grpc-web callers receive
// grpc-web-compatible error responses instead of opaque transport failures.
.layer(GrpcWebLayer::new())
.layer(grpc::rate_limit_concurrent_connections(self.grpc_options))
.layer(grpc::rate_limit_per_ip(self.grpc_options)?)
// Note: must come before the accept layer, as otherwise accept rejections
// Note: must come after the CORS layer, as otherwise accept rejections
// do _not_ get CORS headers applied, masking the accept error in
// web-clients (which would experience CORS rejection).
.layer(cors_for_grpc_web_layer())
.layer(
AcceptHeaderLayer::new(&rpc_version, genesis.commitment())
.with_genesis_enforced_method("SubmitProvenTransaction")
.with_genesis_enforced_method("SubmitProvenBatch"),
)
// Enables gRPC-web support.
.layer(GrpcWebLayer::new())
.add_service(api_service)
// Enables gRPC reflection service.
.add_service(reflection_service)
Expand Down
Loading