AppLayerLabs / bdk-cpp

MIT License
7 stars 12 forks source link

Remove Consensus::doValidatorBlock() requesting transactions #110

Closed fcecin closed 5 months ago

fcecin commented 5 months ago

This PR removes the need for the Consensus component to actively retrieve validator transactions from other validators (when the node is the block proposer) by adding an oooValidatorMempool_ (out-of-order mempool) to the rdPoS engine.

The reason you would have to request validator transactions during new block production is because you received them in the past but tossed them away because they were early (in the testcases, this is always because they are one block ahead). Since the existing validatorMempool_ in rdPoS is specifically for the working round, you can't store validator transactions that you receive that are not for that specific working round. So, a new mempool was created to store all of these, and when the chain advances, the OOO validator mempool is consulted for transactions that should be promoted to the main validator mempool -- as if it had just received those from the network, in the correct height.

This PR also deletes the code that makes Consensus request user transactions from other nodes. This should just not be done.

fcecin commented 5 months ago

This is not needed for rdPoS V1 (NxN full validator socket connectivity network). I will leave the branch as a source of ideas for future work.