Skip to content

feat: Read State - #300

Open
Aman035 wants to merge 56 commits into
developfrom
feat/read-state
Open

feat: Read State#300
Aman035 wants to merge 56 commits into
developfrom
feat/read-state

Conversation

@Aman035

@Aman035 Aman035 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

Brief description of changes.

References

  • Fixes #
  • Related issue/PR:

Changes

Testing

  • go test ./...

Checklist

  • Ready for review
  • Docs updated (if applicable)
  • Env vars updated (if applicable)

Aman035 and others added 30 commits July 28, 2026 16:59
- decode EvmQueryEnvelope (AccountBalance / ERC20Balance / ContractCall /
  StorageSlot) and SolanaQueryEnvelope (LamportBalance / SPLTokenAccount /
  RawAccountData) from ReadSpec.query
- ExecuteRead on each chain client: deterministic pinned-height queries,
  canonical result encoding for identical-bytes ballot voting
- new RPC methods: GetBalanceAt / GetStorageAt / GetHeaderByNumber (EVM),
  GetBalanceWithSlot / GetAccountInfoWithSlot (SVM)
- pushwatcher listener polls pending reads via gRPC and routes each
  READ_REQUEST event into the target chain's DB (Chains.GetStore)
- EventProcessor gains a READ_REQUEST branch: execute on the chain's own
  reader -> vote -> COMPLETED; corrupt/expired -> REVERTED; transient -> retry
- signer narrowed to consumer-side VoteSigner interface; evm/svm clients
  pass themselves as reader
- implementation plan in docs/read-from-chains-implementation-plan.md
Chain clients own writes to their DB: pushwatcher resolves the target
client via GetClient (same as tss consumers) and hands it the event,
instead of writing into the chain's store directly. Drops the
ExternalChainStoreResolver interface and the chainDBs bookkeeping in
the chains manager.
ChainReader moves next to its consumer (EventProcessor), the uint256
canonical encoder moves to types.go, and the near-no-op bytes32 encoder
is inlined at its single call site.
All query types plus failure modes: eth_call revert, invalid envelopes,
transient RPC failures, slot/height constraints, SPL account validation.
compat/orm-api/module matched the module-dir scan, so it was moved into
api/ and removed, breaking the go.mod replace and failing go mod tidy.
Generated with spawn, ORM scaffolding removed to match the other modules
which all use collections. Genesis moved to keeper/genesis.go.
UniversalRead, ReadRequest and ReadResult. ReadRequest mirrors the fields
universalClient expects; ReadResult carries no error text so ERROR ballots
converge. Aggregates reserved for v2 median support.
@Aman035 Aman035 changed the title Feat/read state feat: Read State Aug 7, 2026
Aman035 added 7 commits August 7, 2026 13:37
Wire VoteReadResult to a voteReadResult builder that broadcasts
MsgVoteReadResult through the AuthZ vote path, and register the ucallback
message interface for encoding. Covered by TestVoteReadResult.
Add /ucallback.v1.MsgVoteReadResult to the validator's required grant set
so read-result voting is verified at startup like every other vote.
Add a ucallback query client to pushcore and wire GetAllPendingReadRequests
to AllPendingReadRequests, unwrapping UniversalRead.Request from the response.
Covered by TestClient_GetAllPendingReadRequests.
Swap the temporary uread types for the generated ucallback types across
the read listener, parser, and event processor. Key the read event on the
on-chain requestId directly (a unique incrementing nonce) instead of
hashing it. Adds TestConvertReadRequestEvent.
Adopt the generated ucallback ReadRequest/ReadResult across the evm, svm,
and web2 read executors and the shared ReadRequestHandler interface, with a
common NewReadErrorResult helper for votable ERROR observations.
The read path now uses the generated x/ucallback types, so the uread
proto-mirror is no longer referenced.
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.

2 participants