0

Is there any way to ask tezos-node to tell me the contents of the block it would produce if it were the selected baker for the current round? Somewhere in tezos-node there's a function that makes the next block - is this function exposed in the RPC interface by any chance?

I'm specifically interested in the operations that are likely to be included in the next block, and their ordering, without waiting on another baker to publish it. Technically the selected block producer has total discretion over what goes into the next block, but in practice everyone is just running Octez, so I think the block proposed by my own tezos-node should be close enough, assuming I can get it.

Context: I'm wondering if I can make something like tzflow.com, but with a nice animation of the block coming together. To make this I need intermediate representations of the block, e.g. the candidate block 59 seconds before publication, 58 seconds, ..., 1 second, and then show the next block.

Right now, my best solution would be to look at the mempool and do some hacky reasoning 😩

Thanks!

Edit: Clarified that I want to know the operations included in the next block.

2
  • "> I'd like to know what the next block will likely be" What does that mean? You want to know what operations will be in it? You want to know the hash? The level? What specifically do you want to know? Also, why do you want to know this?
    – utdrmac
    Jul 24 at 0:21
  • Sorry, clarified in the question. Jul 24 at 3:54
1

ask tezos-node to tell me the contents of the block it would produce

No, because tezos-node does not create blocks. tezos-baker-0XX is responsible for creating blocks and it does not have an RPC interface. tezos-baker polls tezos-node first for rights, then if and only if, it is your turn, does tezos-baker then poll for the contents of mempool. tezos-baker then decides which operations to include, based on fees, and gas, constructs the block and injects it to node via RPC.

but in practice everyone is just running Octez

This is a false assumption. 99% are running Octez, yes. But some are running TezEdge, and some will soon be running BakinBacon. Both of these 3rd party bakers have their own logic in deciding which operations to include. Additionally, you're assuming every Octez user is running with the default filters, which they probably are, but some probably are not. And as the popularity of Tezos increases, more bakers will be tweaking these parameters to be more/less inclusive of operations based on fees.

look at the mempool and do some hacky reasoning

That's probably as good as you're going to get due to the factors at play.

1
  • Thanks for the detailed response! Jul 25 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.