celestia-app icon indicating copy to clipboard operation
celestia-app copied to clipboard

All nonPFBtxs are prioritized over PFB txs

Open cmwaters opened this issue 1 year ago • 4 comments

Problem Definition

https://github.com/celestiaorg/celestia-app/blob/be9d7ee0cb8451f4f6c0d98b642068c57460a756/app/prepare_proposal.go#L21-L25

In the above, we observe that the outcome set of txs in filterForValidPFBSignature are used as the input for the Build function. As filterForValidPFBSignature splits the txs into nonPFBs and PFBs, this order instead of the prioritised order is what is fed into the Build method thus nonPFBs take strict precedence over PFBs.

This isn't too detrimental until we get full blocks

It starts to get difficult to juggle all these different requirements: We need to know the order to be able to validate the nonces. We need to keep the priority to know which txs to take and which to dump. Ideally we find an algorithm that gives us valid, full, high paying blocks.

For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned

cmwaters avatar Jun 16 '23 12:06 cmwaters

great write up, yeah, this could be a big issue and I also agree that

It starts to get difficult to juggle all these different requirements:

what do you think about [eventually] using https://github.com/celestiaorg/celestia-app/issues/1105? would this make it more straightforward since we no longer have to separate the tx types?

evan-forbes avatar Jun 17 '23 12:06 evan-forbes

what do you think about [eventually] using https://github.com/celestiaorg/celestia-app/issues/1105? would this make it more straightforward since we no longer have to separate the tx types?

Yeah that's an option. Although we break a lot of people that had built their infrastructure around scanning across a certain namespace

cmwaters avatar Jun 19 '23 15:06 cmwaters

on a side note, we could make this step clearer by having an explicit sorting and then filtering, instead of sorting in the filter function.

https://github.com/celestiaorg/celestia-app/blob/949a2d579619512e9e56eea10538fe847f12306d/app/prepare_proposal.go#L61

as a minor update from the grooming sync, the code has changed slightly, but the bug remains where we are requiring that all blobTx come after normal txs

evan-forbes avatar Feb 27 '24 20:02 evan-forbes

very related to #2977

evan-forbes avatar Feb 27 '24 20:02 evan-forbes