docs: fix pointer mismatches between docs and the merged implementation - #236
Draft
claude[bot] wants to merge 1 commit into
Draft
docs: fix pointer mismatches between docs and the merged implementation#236claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
Corrects documentation that cites specific constants, addresses, method
signatures, parameter shapes, response fields, units, thresholds, or
defaults that differ from the merged podnetwork/pod implementation.
Every corrected value was re-verified against pod @ origin/main
(d6f4b46f) before editing. Highlights:
- Testnet chain ID: 129301 -> 1293 (0x50d)
- Recovery precompile address: 0x...04EC0EE4 -> 0x50d...0003
- pod_getVoteBatches params: (ranges, binary), not two nullable ints
- pod_getBridgeClaimProof response: {proof, committee_epoch,
aux_tx_suffix} with byte arrays, not {signatures, ..} hex strings
- pod_getRecoveryTargetTx response field: hash, not txHash
- ob_getCandles: (orderbook_id, query object), not 4 positional params
- ob_getOrders: orderbook_id filter + paginated envelope w/ snake_case
- ob_getOrderbook: snapshot capped at 10 levels per side
- eth_blockNumber returns wall-clock seconds, not PPT microseconds
- Native USD deposits must carry tx.value; bridge deposits are
whitelisted-ERC-20 only (no 0xEeee... sentinel path)
- Backstop threshold: (2/3) x maintenance margin, not 0.75 x IM
- Batch interval: single global 500ms setting, not per-market 100-200ms
- Finality: n - f count-based quorum, no stake weighting
- pod_subscribe -> pod_waitPastPerfectTime (returns empty result)
- max_funding_rate default: 4% per 8h window; mark_price_clamp naming
- OrderStatus/CandleResolution enums and several always-present
response fields (quote_volume, entry_funding, net_deposits, ...)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A74BZVmHFAksnZWVaGBcgi
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.
Requested by Giorgos Tsimos · Slack thread
Before: the docs quoted values that don't exist in the deployed system — a wrong chain ID, a wrong precompile address, method signatures and response shapes the node never serves — so anyone following them hit rejected transactions, failed deserialization, or silently wrong reads. After: every quoted value in these pages matches the code on
podnetwork/podmaintoday; each fix below was re-verified against the current implementation (pod @d6f4b46f) before editing.Fixes
Audit item numbers refer to the docs audit shared in the Slack thread (HIGH-N / MED-N / LOW-N = report order).
API reference
doc/api-reference/README.md— Testnet chain ID said129301; the network's chain ID is1293(0x50d). Ref:pod/node/src/config.rs:28-29,pod/devnet.sh:105.doc/api-reference/json-rpc/README.md— saideth_blockNumberreturns the latest past-perfection timestamp in microseconds; it returns the node's wall-clock time in whole seconds (as do receiptblockNumbers). The "timestamps are in microseconds" claim is now scoped to deadlines/TTLs. Ref:pod/node/src/rpc/eth.rs:129-132,190-197.doc/api-reference/json-rpc/openapi.yaml—pod_getVoteBatchesdocumented(from_sequence, to_sequence)nullable ints; the method takes(ranges: [[from, to], …], binary?)and can return either a JSON array or{ "data": "<base64>" }. Ref:pod/node/src/rpc/pod.rs:167-172.doc/api-reference/json-rpc/openapi.yaml—ob_getOrderbooksaid omittingdepthreturns all price levels; the served snapshot is hard-capped at 10 levels per side. Ref:pod/node/src/clob/mod.rs:637,770-771. (Also adjusted thedepth = 20example inread-market-data.md.)doc/api-reference/json-rpc/openapi.yaml+doc/api-reference/guides/bridge-from-pod.md— claim-proof response documented as{signatures, committee_epoch, proof}hex strings (guide read camelCaseauxTxSuffix); the node returns{proof, committee_epoch, aux_tx_suffix}with the byte fields as JSON integer arrays (proof= 0x00 type byte + concatenated signatures,aux_tx_suffix= the tx-hash bytes). Schema, example, and both guide tabs fixed. Ref:pod/node/src/rpc/types.rs:958-963,pod/node/src/rpc/pod.rs:1172-1182.doc/api-reference/market-configurations.md— Backstop said0.75 × Initial Margin; the sweep triggers at(2/3) × Maintenance Margin(≈ 0.33 × IM). Ref:pod/trading/src/perps/adl.rs:208-212,pod/node/src/config.rs:685-686.doc/api-reference/guides/place-a-spot-order.md,place-a-perpetual-order.md— native-USD deposit examples sent notx.value, which validation rejects ("CLOB tx value … must equal its native deposit total"); examples now attach the amount as value (and the ABI fragment ispayable). Ref:pod/node/src/clob/mod.rs:2088-2093,pod/e2e/src/clob/mod.rs:446-456.doc/api-reference/guides/read-market-data.md—ob_getCandlesdocumented with 4 positional params; it takes(orderbook_id, {resolution, from_ts, to_ts?, limit?}). Ref:pod/node/src/rpc/ob.rs:41-46,pod/node/src/rpc/types.rs:157-162.doc/api-reference/guides/read-market-data.md— order-history filter used nonexistentclob_ids: […](silently ignored → unfiltered results); the field is singularorderbook_id. Ref:pod/node/src/rpc/types.rs:164-180.doc/api-reference/guides/read-market-data.md—ob_getOrdersreturn shown as a bare array withhash/remainingBase/filledBase; it returns{orders, total_count, next_cursor}withorder_id/tx_hash/initial_size/filled_base_amount/filled_quote_amount. Ref:pod/node/src/rpc/types.rs:452-507,951-955.doc/api-reference/guides/recover-locked-account.md— examples readtxHash/tx_hashfrompod_getRecoveryTargetTx; the response field ishash(andnullwhen not locked). Ref:pod/node/src/rpc/types.rs:1143-1146,pod/node/src/rpc/pod.rs:254-255.doc/api-reference/applications-precompiles/README.md— examples used deprecatedgetBalance(token) returns (uint256)with no account (queriesaddress(0)); switched tobalanceOf(token, account) returns (int256). Ref:pod/node/src/clob/contract.rs:81-86.doc/api-reference/applications-precompiles/README.md— token0x…0001labeled USDT; it is NVDAx (Tokenized NVIDIA). Ref:pod/docker-compose.yaml:4-6,pod/devnet.sh:33,108.doc/api-reference/applications-precompiles/orderbook.md—update()'stokenparam described as choosing the collateral token; the engine ignores it (spot locks in the resting order's own token, perps use cross-margin). Ref:pod/node/src/clob/mod.rs:3270-3296,pod/trading/src/batch.rs:26-38.openapi.yaml—OrderStatusenum missingmargin_canceledandinvalid(the latter serialized as{"invalid": "<reason>"}); filter-vs-response value sets noted. Ref:pod/trading/src/order.rs:23-39,pod/node/src/rpc/types.rs:183-197.openapi.yaml—PositionsResponsemissing always-presentnet_deposits;account_valuedescription missing the resting-spot-buy escrow component. Ref:pod/node/src/rpc/types.rs:758-788,pod/trading/src/engine.rs:396-427.openapi.yaml—CandleResolutionmissing30m,1w,1M. Ref:pod/node/src/rpc/types.rs:79-99.market-configurations.md— Oracle parameter described as "Pyth asset"; it is a<source>/<asset>spec with four sources (PythNetwork, PythPro, Hyperliquid, Nobi). Ref:pod/node/src/oracle/source.rs:23-66. (The per-market Oracle column values were left as-is — the live testnet assignments are deployment config not present in the repo, so no authoritative replacement values could be verified.)doc/api-reference/guides/optimistic-auction.md— Rust tab built the key withPRIVATE_KEY.parse(), whichSigningKeydoesn't support for hex strings; nowSigningKey::from_slice(&hex::decode(…)), matching the SDK's own examples. Ref:pod-sdk/rust-sdk/src/provider/mod.rs:83-90,pod-sdk/examples/notary/src/main.rs:156-157.doc/api-reference/guides/place-a-perpetual-order.md— said oversized reduce-only orders are rejected; they are clamped at match time to the position size (rejection happens only at submission for no-position/same-side). Ref:pod/trading/src/margin.rs:209-215,pod/trading/src/perps/mod.rs:1099-1113.openapi.yaml—Orderschema missingincluded_batch(always present) and perprealized_pnl. Ref:pod/node/src/rpc/types.rs:470-492.openapi.yaml—Candleschema missing always-presentquote_volume. Ref:pod/node/src/rpc/types.rs:101-116.openapi.yaml—PerpPositionmissingentry_funding(already referenced by its own field formulas). Ref:pod/node/src/rpc/types.rs:922-929.openapi.yaml—BackstopTransferResponsemissingrealized_pnl. Ref:pod/node/src/rpc/types.rs:239-254.openapi.yaml—last_clearing_price/high_24h/low_24h/price_change_24hare nullable before a market's first trade; now marked nullable. Ref:pod/node/src/rpc/types.rs:35-47.openapi.yaml—eth_estimateGasdoesn't just return 21000: fee-exempt tuples return 0 andsubmitBatchreturns 21000 × sub-intents. Ref:pod/node/src/rpc/eth.rs:243-268,pod/node/src/gas.rs:59-141,pod/node/src/clob/contract.rs:292-308.rollupboost-priority-auctions.md— "working implementation" link pointed to a third-party personal repo; now points to this repo'sexamples/optimism-tx-auction.bridge-to-pod.md— permit comments now state the required nonstandard 97-byte packed encodingdeadline(32) || v(1) || r(32) || s(32). Ref:pod-sdk/protocol/src/Bridge.sol:101,279-296.place-a-perpetual-order.md— margin formula said|size| × price / maxLeverage; margin is computed against the mark price. Ref:pod/trading/src/margin.rs:188-190.Protocol docs
doc/api-reference/guides/bridge-to-pod.md,doc/protocol/network-architecture/README.md— told users to pass the0xEeee…sentinel / "deposit ETH";Bridge.depositis non-payable and only accepts whitelisted ERC-20s, so that call always reverts. Ref:pod-sdk/protocol/src/Bridge.sol:298-302,329-356.doc/protocol/margin.md— liquidations described as market orders; they are reduce-only limit orders at the bankruptcy price that rest across batches. Ref:pod/trading/src/perps/liquidation.rs:270-308.doc/protocol/margin.md—withdrawable_cash = min(available_margin, cash)with "unrealized PnL is not withdrawable"; actual ismax(0, available_margin)(zero below maintenance). Ref:pod/trading/src/engine.rs:170-188,pod/trading/src/perps/mod.rs:1994-2010.doc/protocol/markets-overview.md,doc/protocol/orderbook.md— batch interval said per-market configurable, 100–200ms expected; it is one global setting, default/current 500ms. Ref:pod/node/src/config.rs:680-682,906-908.doc/protocol/network-architecture/local-ordering.md— recovery precompile address said0x…04EC0EE4; it is0x50d0000000000000000000000000000000000003. Ref:pod/node/src/recovery/contract.rs:16.doc/protocol/network-architecture/timestamping.md— named a nonexistentpod_subscribeendpoint; the method ispod_waitPastPerfectTime. Ref:pod/node/src/rpc/pod.rs:247-248.timestamping.md,censorship-resistance.md— said the full node "returns a past perfect set"; the call returns an empty result and the set is fetched separately (e.g.eth_getLogs,pod_listConfirmedReceipts). Ref:pod/node/src/rpc/pod.rs:1044-1106.doc/protocol/margin.md— cash formula omitted realized PnL settlement; nowcash = deposits − withdrawals + funding_payments + realized_pnl. Ref:pod/trading/src/perps/mod.rs:530-535.doc/protocol/margin.md— ADL counterparties said sorted by leverage; they are ranked by profit ratio × leverage, non-positive-equity accounts first. Ref:pod/trading/src/perps/adl.rs:592-617.doc/protocol/margin.md— said "the underwater position itself is also closed"; ADL partially closes only losing legs to ~zero equity, then sweeps the remainder to the backstop. Ref:pod/trading/src/perps/adl.rs:269-305.network-architecture/README.md,transaction-flow.md— finality said "supermajority (4/5) by stake"; the quorum is count-based n − f under n ≥ 5f + 1 with no stake weighting. Ref:pod/node/src/lib.rs:259,290,326.local-ordering.md— post-recovery guidance said next nonce = stuck nonce + 1; the recovery tx itself occupies a nonce above the stuck one, and the next usable nonce is recovery nonce + 1. Ref:pod/node/src/recovery/mod.rs:245-251,pod/e2e/src/recovery.rs:124-140.timestamping.md— heartbeats said every ~20ms; they are an idle fallback (40ms ticker after ~50ms without activity). Ref:pod/node/src/lib.rs:5627-5631.doc/protocol/orderbook.md— said all markets use 1e18 tick sizes; tick size is per-market with a 1e16 default. Ref:pod/node/src/config.rs:31-32.doc/protocol/orderbook.md,applications-precompiles/orderbook.md— removed the claimed 10-minute cap on deadline headroom; no upper bound is enforced. Ref:pod/node/src/clob/mod.rs:2876-2901.doc/protocol/orderbook.md,market-configurations.md— solver said per-market configurable / rotating; there is one global solver key andcreateOrderBookrejects any other. Ref:pod/node/src/config.rs:673-675,pod/node/src/clob/mod.rs:3052-3060.doc/protocol/perpetuals.md—max_funding_ratedefault said 4% per hour; it is 4% per funding window (8h), and both rate params are per-window. Ref:pod/trading/src/perps/config.rs:31-35.doc/protocol/margin.md— ADL close price said "last batch price"; it is the previous batch's mark price. Ref:pod/trading/src/perps/adl.rs:326-345.doc/protocol/markets-overview.md— "Market precompile" doesn't exist under that name; it is the Orderbook (CLOB) precompile. Ref:pod/node/src/clob/contract.rs.timestamping.md— past perfection said to advance on heartbeats specifically; it advances on every signed vote batch (heartbeats are the idle fallback). Ref:pod/node/src/lib.rs:7380-7396.doc/protocol/perpetuals.md— parameter namedmark_clamp_pct; the config field ismark_price_clamp(default 1%). Ref:pod/trading/src/perps/config.rs:66-71,159-163.Not included
remainingBasereversed subtraction /startTsduplication) — the precompilegetOrdersmethod is being removed in a separate PR, and HIGH-2 is a code bug, not a doc fix.ob_getOrderbookbuy-side ordering / depth truncating from the wrong end) — a code bug in the RPC serialization path; documenting the broken behavior would be wrong once fixed.pod_waitPastPerfectTime500ms cap breaks the auction guide's single call) — fixing requires new example logic (alignment arithmetic, polling loops), not value substitution; suggested as a follow-up examples PR.doc/protocol/orderbook.md— covered by pod-sdk#231; untouched here.ob_getSolutions), MED-33 (undocumented error code 997), LOW-56 (read-only-mode -32000 variant), LOW-69 (Pod-side withdraw limits) — additive documentation of missing surfaces, not mismatch fixes.depthparsed but never applied — likely a code bug), MED-50 / LOW-66 (attestation streaming / client→validator flow narrative), MED-55 (competition scoring metric — product decision), LOW-70 (bridge pinned to Ethereum vs. the Arbitrum deployment — deployment/positioning decision).🤖 Generated with Claude Code
https://claude.ai/code/session_01A74BZVmHFAksnZWVaGBcgi
Generated by Claude Code