0xMiden / 0xMiden/node

Investigate returning account proofs as part of `SyncTransactions`

未关闭
#2,372 3 条评论 0 个 reaction 已指派 1 人 已被 @kkovaacs 认领 在 GitHub 查看
rpc rpc stabilization
主要语言
Rust
星标
104
派生
138
平均合并
1 天 13 小时
30 天内合并 PR
56

描述

Currently, from the client, there are various levels to utilize FPI-related data on a per-transaction basis:

- You can describe what data you are going to need from an account before hand (specific vault or storage map witnesses) and those get fetched in bulk, alongside a corresponding account witness, before executing
- Anything that's not pre-loaded gets retrieved on execution runtime, but those are retrieved individually (so that adds up to one RTT per requested witness)
- You can also import "watched" foreign accounts, which gets you updates for those accounts on every `Client::sync_chain()` call. Then, on runtime, vault and storage map keys are retrieved from your local store. However, the account proof still needs to be retrieved during execution because no sync-related endpoint currently returns it.

It would be interesting to investigate the possibility of adding account proofs to a sync endpoint in order to let a client store an account proof on a sync. A simple way to add this could be to add an optional `account_witnesses` for the `SyncTransactions` request that returns account proofs for a limited set of account IDs. On the client we could already implement this by doing `GetAccount` whenever it syncs, but this is a bit wasteful and also incurs an extra RTT.
An alternative (IIUC this is what @bobbinth meant) could be to let the node operator configure which account proofs it can send, and this can be useful for faucets that can have callbacks which we know a client is going to need frequently (e.g., the native token faucet). This can be optimized in a way that becomes quite cheap for the node, and would alleviate pressure from a good amount of `GetAccount` which would then become redundant.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。