Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: verifiable-api #505

Merged
merged 49 commits into from
Mar 7, 2025
Merged

feat: verifiable-api #505

merged 49 commits into from
Mar 7, 2025

Conversation

eshaan7
Copy link
Contributor

@eshaan7 eshaan7 commented Feb 5, 2025

ToDo

Endpoints

  • eth_getProof - GET /eth/v1/proof/account/{address}
  • eth_getBalance - GET /eth/v1/proof/account/{address}
  • eth_getTransactionCount - GET /eth/v1/proof/account/{address}
  • eth_getCode - GET /eth/v1/proof/account/{address}?includeCode=true
  • eth_getStorageAt - GET /eth/v1/proof/account/{address}?storageSlots={slots}
  • eth_getTransactionReceipt - GET /eth/v1/proof/transaction/{hash}/receipt
  • eth_getLogs - GET /eth/v1/proof/logs
  • eth_getFilterLogs - GET /eth/v1/proof/filterLogs
  • eth_getFilterChanges - GET /eth/v1/proof/filterChanges
  • eth_call - POST /eth/v1/proof/createExtendedAccessList
  • eth_estimateGas - POST /eth/v1/proof/createExtendedAccessList
  • eth_createAccessList - POST /eth/v1/proof/createExtendedAccessList
  • eth_chainId -> GET /eth/v1/chainId
  • eth_sendRawTransaction -> POST /eth/v1/sendRawTransaction
  • eth_getBlockByHash -> GET /eth/v1/block/{block_id}
  • eth_getBlockByNumber -> GET /eth/v1/block/{block_id}
  • eth_getBlockReceipts -> GET /eth/v1/block/{block_id}/receipts
  • eth_newFilter -> POST /eth/v1/filter
  • eth_newBlockFilter -> POST /eth/v1/filter
  • eth_newPendingTransactionFilter -> /POST eth/v1/filter
  • eth_uninstallFilter -> DELETE /eth/v1/filter/{filter_id}

Other

  • Integration with helios-ts (Wasm)
  • Unit tests for verifiable-api
  • Integration tests (something similar to RPC equivalent tests)
  • Documentation
  • Dockerfiles

@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch 4 times, most recently from aa7f092 to 2d5c06c Compare February 7, 2025 11:12
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 2d5c06c to 5a15742 Compare February 7, 2025 11:13
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 439c8a1 to 31d376e Compare February 10, 2025 11:01
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 31d376e to 265f7f3 Compare February 10, 2025 13:44
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from f8d93b3 to baff83f Compare February 11, 2025 18:36
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from baff83f to c99886f Compare February 11, 2025 18:44
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from c19fa60 to 86fac3b Compare February 12, 2025 17:11
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch 2 times, most recently from a66cbe7 to 34abdfe Compare February 28, 2025 17:15
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 34abdfe to 10090e7 Compare February 28, 2025 17:16
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 54cf1b4 to 4e005ab Compare February 28, 2025 22:09
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 45d4bac to 6cefbd8 Compare March 3, 2025 06:57
Ok(id)
}

async fn new_block_filter(&self) -> Result<U256> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused?

Copy link
Contributor Author

@eshaan7 eshaan7 Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the filter is created on the underlying RPC, and its filter ID is stored in Helios and returned to the user. However, when the user requests filter changes for this filter ID, the response is constructed from Helios's state without querying the underlying RPC. This means we can likely eliminate the initial call as well, generating the filter ID on Helios side itself.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah lets do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we should get rid of new_block_filter from both RPC and API altogether since it will not be used by Helios?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think if we have unused methods it makes sense to cut them unless you see a reason to keep them?

Copy link
Contributor Author

@eshaan7 eshaan7 Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it in the Verifiable-API for completeness, even if Helios doesn't use it.

The POST /eth/v1/filter endpoint allows requests with a kind value of Logs, NewBlocks, or NewPendingTransactions, effectively replacing the eth_newFilter, eth_newBlockFilter, and eth_newPendingTransactionFilter RPC methods.

Removing NewBlocks option would make the implementation feel incomplete.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't think it's a big issue to rely on the underlying RPC to return the filter ID so might just wanna keep the current implementation for simplicity's sake.

@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 6930ed7 to 5206b89 Compare March 6, 2025 09:36
@eshaan7
Copy link
Contributor Author

eshaan7 commented Mar 6, 2025

Note that there's a good amount of redundant code in this PR because of the need to convert b/w BlockTag & BlockId at many diff places. This would be addressed separately in #524.

@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch 2 times, most recently from ecc5fb7 to 73f8db5 Compare March 6, 2025 21:13
@eshaan7 eshaan7 force-pushed the feat/verifiable-api branch from 73f8db5 to 46ea202 Compare March 6, 2025 21:17
@eshaan7 eshaan7 marked this pull request as ready for review March 7, 2025 08:49
@eshaan7 eshaan7 changed the title feat: init verifiable-api crate feat: verifiable-api Mar 7, 2025
@ncitron ncitron merged commit 5dc4fde into a16z:master Mar 7, 2025
6 checks passed
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