Skip to content

Commit 1b82300

Browse files
authored
Merge pull request #1151 from Lay3rLabs/wavs-skill-block-height-queries
docs: document block-pinned component reads
2 parents e5e97f3 + c1e13bf commit 1b82300

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.claude/skills/wavs/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ WAVS runs off-chain computation as sandboxed WebAssembly (WASI) components trigg
1414

1515
---
1616

17+
## Deterministic On-Chain Reads
18+
19+
Treat the trigger/event block height as the canonical snapshot for on-chain data that relates to that trigger. When a component performs EVM, Cosmos, or other RPC reads and the client/API supports it, pass the trigger block number or block height explicitly instead of reading `latest` state.
20+
21+
Avoid mixing historical trigger data with unpinned latest-state reads. Pinning reads to the trigger block improves replayability and prevents nondeterministic state/timestamp mismatches, such as an oracle response whose `updatedAt` appears newer than the block timestamp because an RPC backend served cached state from a different snapshot.
22+
23+
---
24+
1725
## MCP Setup
1826

1927
The `wavs:` MCP tools below require `wavs-mcp` to be running and registered with Claude Code.

.claude/skills/wavs/flows/component-dev.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ use example_helpers::trigger::{decode_trigger_event, encode_trigger_output};
7777

7878
## Host APIs
7979

80+
For on-chain reads related to a trigger, use the trigger's block height as the canonical snapshot. Pass that block number/height to EVM, Cosmos, or RPC calls when supported, and avoid mixing historical trigger data with unpinned `latest` reads.
81+
8082
```rust
8183
host::config_var("my-key") // → Option<String>; reads service config
8284
host::log(host::LogLevel::Info, "msg"); // levels: Debug, Info, Warn, Error

0 commit comments

Comments
 (0)