Replies: 1 comment 1 reply
-
Disclaimer: I think I just wrote about 2-3 semi-unrelated topic, treat this comment as a kind of brain-dump 😄 👍 I think the general idea for this is good, but I wonder what we are trying to test here. Clients/ELs can decide for themselves what transactions they are including and in what order. If a test mandates this, one is essentially testing if a block building strategy used by the client is following a certain ruleset. What would be an example here which could be tested? Should I see this as a setup for a test format to be used by for instance MEV operators? In general, I think if a TxPool has X valid transactions where these do not exclude another (so no txs with the same sender and nonce), they are all willing to pay the base fee of the block, the nonce is correct, the sender has enough balance and the sum of the gas limit when these txs are executed (in any order) is less than or equal to the block gas limit, the test should check if all txs are included in the block. This could be in any order, of course following the default consensus rules (txs from same sender have increasing nonce in the tx list). Test format:
I don't think we should do this. The amount of different Race conditions I'm not sure, but I also don't think that it's possible to inspect the mempool on most clients over RPC (and even if it is, there likely is no standard API for this), so it dos not seem possible to see if the tx has "succesfully" entered the pool (?). This thus could lead to false positives where txs are not included in the block, but the only reason is that they have not entered the mempool yet. When the test is re-ran, it could pass. External test factors like |
Beta Was this translation helpful? Give feedback.
-
Description
Create a new test type and fixture format that would help to verify the block building behavior of the clients, and indirectly, their mempool implementations to some degree.
The fixture type could be processed by the
consume
command and run using hive, by launching a client and performing many of the following steps in sequence but in the order dictated by the fixture:eth_sendRawTransaction
engine_forkchoiceUpdatedV*
andengine_getPayloadV*
engine_forkchoiceUpdatedV*
The fixture could also be processed by a client's internal test consumer (like
evm blocktest
orevm statetest
).The challenge of this format is that the ordering of the transactions of a block produced varies depending on the client, and therefore the verification is not straightforward.
To mitigate this, the fixture can contain rules on the verification of the transactions included in the payload, instead of expecting a single specific list of transactions or a block, for example:
Sorted transactions
of which any is an acceptable transaction order.With these rules, the test consumer can evaluate the received block and either pass or fail the test.
We can explore the possibility to include all possible
stateRoot
combinations in the fixture, but this would make the test too fragile.Beta Was this translation helpful? Give feedback.
All reactions