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

Add sequencer getblock command #97

Closed
steezeburger opened this issue Jun 3, 2024 · 3 comments
Closed

Add sequencer getblock command #97

steezeburger opened this issue Jun 3, 2024 · 3 comments
Assignees

Comments

@steezeburger
Copy link
Member

steezeburger commented Jun 3, 2024

We should probably have a get_block or GetBlock or w/e casing we’re using in go land.
The reason I ask is because I’m trying to understand how various stuff works, we emit Deposit events when a BridgeLock is sent to a bridge account, would be cool if I had the ability to:

  • create a bridge account
  • transfer to it
  • look at block
  • bridge lock to it
  • look at block

And observe that there is a Deposit event

@jbowen93
Copy link
Member

jbowen93 commented Jun 3, 2024

Where are the Deposit events stored in the SequencerBlock?

They are there they are in the transactions of the rollup_transactions those bytes are protobuf encoded RollupData. Which has a oneof of either Deposit or bytes of sequenced_data. They are bytes that need further decoded for merkle tree verification purposes.

GetSequencerBlock

Deposit

astria-geth GetDeposit()

SequencerBlock {
  ...
  RollupTransactions: []{
    {
      RollupId: 1
      Transactions: []{
        {<rollup serialized data>},
        {<sequencer serialized deposit},
      }
    }
  }
}

@jbowen93
Copy link
Member

jbowen93 commented Jun 3, 2024

The Sequencer API gives you a SequencerBlock which contains RollupTransactions which has a repeated transactions field which is implicitly the serialized bytes for RollupData.

Using the Sequencer API to retrieve a block will not give you the RollupData object, but this is protobuf encoded, so it should be able to do something like the pseudo code:

for (per_rollup_txs in rollup_transactions) {
  for (txs in per_rollup_txs) {
    for (tx in txs) {
      RollupData data = tx.deserialize()
    }
  }
}

@sambukowski
Copy link
Contributor

closed by #104

@sambukowski sambukowski self-assigned this Jun 12, 2024
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

No branches or pull requests

3 participants