Skip to content

3.0.0 party 2/6: livenet client - #669

Closed
kubaplas wants to merge 6 commits into
party/1-storage-layout-and-quick-winsfrom
party/2-livenet-client
Closed

kubaplas wants to merge 6 commits into
party/1-storage-layout-and-quick-winsfrom
party/2-livenet-client

Conversation

@kubaplas

Copy link
Copy Markdown
Contributor

Layer 2 of 6 of the 3.0.0 party stack (bottom-up: 1 → 2 → 3 → 4 → 5 → 6, bottom is #668). Each layer targets the branch below; merge from the bottom. The top of the stack is the tree verified on OdraVM, CasperVM and NCTL; docs are in odradev/odradev.github.io#58 and #59, the migration guide covers every breaking change.

Closes #579, closes #472, closes #665.

  • Reads cost fewer RPCs: the state root hash is cached (5 s TTL, dropped after every own transaction) and query responses are cached per state root. 31 getter calls: 64 → 6 node queries (Optimize livenet queries amount #472).
  • HTTP 429 / "throttled by the node" reads are retried with backoff; failed global-state queries are logged and surface as real errors (Livenet: reading <x> of <contract> failed: ..) instead of the misleading "Couldn't query for entity address" panic. CasperClient read methods return Result<Option<_>> (breaking for rpc-client integrations).
  • Clear error for an account that has never been funded: "no such addressable entity" explained (Error when using account withouth CSPR, that was never used. #579).
  • wasm client codegen no longer emits an empty <Contract>Errors enum, which wasm-bindgen rejected; the template CI runs generate-client (wasm client codegen emits an empty <Contract>Errors enum, which wasm-bindgen rejects #665).
  • CI: coverage and template workflows pin the same nightly as rust-toolchain.

🤖 Generated with Claude Code

kubaplas and others added 6 commits September 18, 2026 10:16
…579)

Also dedupe the three account_put_transaction error mappings into one helper.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CasperClient reuses a fetched state root hash for up to 5 seconds and
forgets it after every transaction it sends, so its own writes are
visible to the next read. erc20_on_livenet: 18 -> 2 chain_get_state_root_hash
calls out of 39 RPC calls total.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nodes and sidecars answer HTTP 429 or a -32018 'throttled by the node'
JSON-RPC error under a burst of reads; the client now retries such
calls with exponential backoff (5 attempts). query_global_state_maybe
used to turn every error into None, which surfaced as a misleading
'Couldn't query for entity address' panic; transport/HTTP failures are
logged as warnings now, a missing value at debug level.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CasperClient keeps global state and dictionary responses for the state
root hash they were read at; a query at a fixed root is deterministic,
so this is equivalent to asking the node, and the cache is dropped when
the root moves on (TTL or own transaction). A burst of 31 getter calls
goes from 64 node queries to 6.

get_value / get_named_value / get_dictionary_value / events_count return
Result<Option<_>> instead of Option: a node that cannot be asked is no
longer reported as a missing value. The livenet host and contract env
stop with 'Livenet: reading <what> of <address> failed: <reason>'; the
internal 'Couldn't query for entity address value' panics are gone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
wasm-bindgen rejects empty enums, which broke generate-client for every
contract without user errors (the whole workspace template). The
template CI now runs generate-client too and also triggers on changes
to the wasm client crates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…orkflows

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kubaplas kubaplas mentioned this pull request Sep 18, 2026
@kubaplas
kubaplas added this pull request to stack #674 September 18, 2026 08:24
@kubaplas
kubaplas removed this pull request from stack #674 September 18, 2026 08:57
@kubaplas

Copy link
Copy Markdown
Contributor Author

Closing: the 3.0.0 party goes back to a single pull request, #664. The commits here are the same work, so nothing is lost.

@kubaplas kubaplas closed this Sep 18, 2026
@kubaplas
kubaplas deleted the party/2-livenet-client branch September 18, 2026 08:57
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.

1 participant