Skip to content
New issue

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

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

Already on GitHub? # to your account

[subxt] Allow transactions in recent blocks to be decoded #31

Closed
1 of 3 tasks
jsdw opened this issue Oct 14, 2022 · 1 comment · Fixed by paritytech/subxt#929
Closed
1 of 3 tasks

[subxt] Allow transactions in recent blocks to be decoded #31

jsdw opened this issue Oct 14, 2022 · 1 comment · Fixed by paritytech/subxt#929
Assignees

Comments

@jsdw
Copy link
Collaborator

jsdw commented Oct 14, 2022

The Vision

Subxt can already decode events, constants and storage entries, but it can't decode recent blocks. This feels like a key missing part of the API, so let's add support for this.

The Plan

  • Create a "block-centric" API for subscribing to blocks and accessing the transactions, events and storage in the block.
  • Allow extrinsic bytes to be dynamically decoded into some Values representing call data.
  • Allow attempts to statically decode extrinsics into some tuple or struct representing call data?

Open Questions

  • Can we do anything about block signatures?
  • How far can we statically vs dynamically decode transactions? I think we'll look to the Events API for inspiration here and probably offer a similar interface. Like Events, we may not have the information we need to be able to decode all transactions (we might know only about a subset of pallets).

Here is the corresponding GitHub milestone:

https://github.com/paritytech/subxt/milestone/15

@jsdw jsdw moved this to Open in Parity Roadmap Oct 14, 2022
@jsdw jsdw changed the title [subxt] Add "Blocks" api to decode recent blocks. [subxt] Allow transactions in recent blocks to be decoded Feb 20, 2023
@lexnv lexnv self-assigned this May 2, 2023
@lexnv
Copy link

lexnv commented May 10, 2023

Patch series

Subxt is now capable of:

  • decoding as root extrinsic: enum containing all possible extrinsics from all pallets
  • decoding as pallet extrinsics: enum containing all possible extrinsics from a pallet
  • decoding as extrinsic variant: struct containing just the extrinsic details of a pallet
  • decode extrinsics into some dynamic Value<()> via exposing the bytes and field's shape
  • exposing the address bytes of the account that signed the extrinsic if applicable
  • iterating extrinsics from the block

These enhancements will significantly improve the decoding functionality of subxt and
enable more efficient analysis of extrinsics.

@lexnv lexnv closed this as completed May 10, 2023
@github-project-automation github-project-automation bot moved this from Open to Closed in Parity Roadmap May 10, 2023
@jsdw jsdw reopened this May 10, 2023
@jsdw jsdw moved this from Closed to Open in Parity Roadmap May 10, 2023
@lexnv lexnv linked a pull request May 10, 2023 that will close this issue
3 tasks
@jsdw jsdw closed this as completed May 10, 2023
@jsdw jsdw moved this from Open to Closed in Parity Roadmap May 10, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants