improve(server): replace Node sidecar with native Rust SDKs (ENG-1700)#134
Open
harrymove-ctrl wants to merge 4 commits intodevfrom
Open
improve(server): replace Node sidecar with native Rust SDKs (ENG-1700)#134harrymove-ctrl wants to merge 4 commits intodevfrom
harrymove-ctrl wants to merge 4 commits intodevfrom
Conversation
benchmark-smoke.yml and benchmark-live.yml drove the now-deleted services/server/scripts/bench-recall-latency.ts. Both fail at actions/setup-node because services/server/scripts/package-lock.json no longer exists. The benchmark target itself is gone with the sidecar; restore in a follow-up ticket once a Rust-native benchmark driver lands. docs/relayer/benchmark-ci-setup.md still references these files but is out of scope to rewrite here — flagged for the follow-up.
Collaborator
|
Hi @harrymove-ctrl https://publisher.walrus-mainnet.walrus.space we are using upload relay to upload, your method will not work when on mainnet |
Match the legacy Node sidecar's env contract (`sidecar-server.ts:65-69`)
so Railway's dev/staging/mainnet env values keep working without rename:
- Read `WALRUS_UPLOAD_RELAY_URL` (was: `WALRUS_PUBLISHER_URL`, a name we
invented and that no env actually sets).
- Per-network defaults: `upload-relay.{testnet,mainnet}.walrus.space`.
- Same per-network Sui RPC fallback factored into one helper.
Known gap (ENG-1700 follow-up): the default `upload-relay.*` endpoint
speaks the multi-step register/upload/certify relay protocol used by
@mysten/walrus, while `walrus_publisher.rs` currently only speaks the
simpler `PUT /v1/blobs` public-publisher protocol. Until the relay
protocol is ported (Path A), `WALRUS_UPLOAD_RELAY_URL` must be set to a
`publisher.walrus-{net}.walrus.space` endpoint. Inline doc + helper
explain.
…k fallback (ENG-1700) Reverts the env-name change from 33422e7. Railway sets `WALRUS_PUBLISHER_URL` across dev/staging/mainnet (verified against the production Raw Editor): e.g. `WALRUS_PUBLISHER_URL=https://publisher.walrus-mainnet.walrus.space` on production. The previous commit renamed the read to `WALRUS_UPLOAD_RELAY_URL` (sidecar's internal var name, NOT what Railway exports), which made the server fall back to the per-network upload-relay default — an endpoint that doesn't accept `PUT /v1/blobs` and returned 404 on every upload. Also drops the speculative testnet/mainnet branching default added in 33422e7. The single-line read with one fallback (matching the original pre-33422e7 code) is enough — Railway always sets the env var.
Collaborator
|
Hi @harrymove-ctrl still use publisher
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
services/server/scripts/) the Rust server spawned at boot. SEAL / Walrus / Enoki now run in-process via Mysten Rust SDKs + thinreqwestclients.SIDECAR_*), same routes, same wire formats. Scope confirmed with @henry.nguyen on Linear.npm ci, faster boot (no 30s sidecar health-check loop)Linear: ENG-1700
What's gone
services/server/scripts/sidecar-server.ts(1039 LOC) and the rest ofscripts/.SIDECAR_URL,SIDECAR_AUTH_TOKEN,SIDECAR_SCRIPTS_DIRconfig + spawn/health-check/shutdown plumbing inmain.rs.Setup Node+Install sidecar depssteps in CI.apps/app/src/config.ts:sidecarUrlfield (was never read by the FE).What's new (Rust modules)
seal.rs(rewritten)seal-sdk/seal/*seal_keyserver.rs/v1/fetch_key+ on-chain key-server resolution@mysten/sealSealClientHTTP layerenoki.rshttps://api.enoki.mystenlabs.com/sponsor+/sponsor/executewalrus_publisher.rsPUT /v1/blobs?epochs=N&send_object_to=…@mysten/walrusupload stepwalrus_onchain.rswalrus.rsorchestrates the publisher + on-chain pieces;seal.rs/walrus.rskeep the same public function signatures soroutes/maindon't need ripple edits.Security
tracing!()interpolation of secret materialENOKI_API_KEYBearerAuthorizationheader, never logged/sponsor+/sponsor/executerate limit + signature length validationEnokiError::to_status()— generic strings only ("Sponsor service temporarily overloaded", "Sponsor request rejected"); full detail to server logseal_approveaccepts onlyInput::Sharedimmutable forMemWalAccount;idbound to caller's owner addressmap_publisher_error→AppError::Internalwith deterministic generic messageseal_keyserverRequest-Id (replay)uuid::Uuid::new_v4()per requestTest plan
cargo test --bin memwal-server— 164 passed, 1#[ignore](live testnet regression for Shared-input bug).cargo clippy— no new warnings in migration files.Sponsored by 0x…field on suiscan for server-paid metadata+transfer txns.dropped_count: 0) — bothx-seal-sessionandx-delegate-keypaths.