3

I'm trying to build a light client and want to know how solana stuffs a block with transactions. In bitcoin they use merkle trees to stuff all the txns in one block.

My hypothesis is that if I can verify if a txn is part of a block using something like merkle if solana uses that then that would be enough to for a POC Light Client.

Happy to be corrected if I'm wrong and would appreciate any answers, my apologies if this is a trivial question, thanks.

1 Answer 1

3

Solana uses a leader schedule to assign who will create blocks during small time windows that we call slots. Each slot has exactly one leader, and at most one block can be produced during one slot.

During a slot in which a node is a leader, the node processes transactions in parallel and sends them out to the rest of the network as it determines that these transactions should be included in the block. The other nodes that are serving as validators collect, replay, and then vote on this block.

The only way to see if a specific tx is in a block is to have the entire block, deserialize it and check for the desired tx signature. In order to do so for arbitrary tx's & blocks, the node must be able to ingest all of these blocks as they come in. In order to ensure that you are getting valid blocks, your node needs to replay the transactions and see if the state matches the state that clusters reaches consensus on.

I'm not sure exactly how your hypothetical "light client" might function, but from the above, it should be clear that there aren't any shortcuts for reliably determining if a specific tx is in some block.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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