Problem. Revert payloads travel as JSON-quoted hex strings that guests must trim and decode by hand, and RPC codes are smushed into a domain-relative s32.
Change. Add record rpc-error { code: s32, message: string, data: option<list<u8>> } and variant chain-error { fault(fault), rpc(rpc-error) } to chain.wit. The host hex-decodes error.data once. Add From<ProviderError> for ChainError. decode_revert takes &[u8], and decode_revert_hex's quote-stripping is removed. Update the twap poll path and the chainlink helper to match.
Files. chain.wit, host/impls/chain.rs, host/error.rs, provider_pool.rs, nexum-sdk chain plus macro, shepherd-sdk cow/composable, twap-monitor.
Risk / size. M.
Depends on. Sub-issue A, in parallel with sub-issue B.
Problem. Revert payloads travel as JSON-quoted hex strings that guests must trim and decode by hand, and RPC codes are smushed into a domain-relative
s32.Change. Add
record rpc-error { code: s32, message: string, data: option<list<u8>> }andvariant chain-error { fault(fault), rpc(rpc-error) }to chain.wit. The host hex-decodeserror.dataonce. AddFrom<ProviderError> for ChainError.decode_reverttakes&[u8], anddecode_revert_hex's quote-stripping is removed. Update the twap poll path and the chainlink helper to match.Files. chain.wit, host/impls/chain.rs, host/error.rs, provider_pool.rs, nexum-sdk chain plus macro, shepherd-sdk cow/composable, twap-monitor.
Risk / size. M.
Depends on. Sub-issue A, in parallel with sub-issue B.