Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the txpool, reject a tx if its simulation fails #2

Merged
merged 13 commits into from
Apr 11, 2024

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented Apr 9, 2024

This PR adds the option to perform a simulation of the tx when adding it to the txpool, and rejecting it in case the simulation fails, due to the tx being invalid, reverted or any module line count is over the limit. If the tx is rejected then an error response is returned to the caller of eth_sendRawTransaction.

There are 2 new options to enable/disable this check, depending on the source of the tx:

  • plugin-linea-tx-pool-simulation-check-api-enabled: by default true, enables the check for transactions sent via eth_sendRawTransaction
  • plugin-linea-tx-pool-simulation-check-p2p-enabled: by default false, enabled the check for transactions sent via P2P

@fab-10 fab-10 force-pushed the eth-sendrawtransaction-line-count-integration branch from 9183d34 to b8464d7 Compare April 10, 2024 08:40
@fab-10 fab-10 changed the title Reject a tx, sent via eth_sendRawTransaction, if exceeds any of the module line count limit Reject a tx, sent via eth_sendRawTransaction, if its simulation fails Apr 10, 2024
@fab-10 fab-10 force-pushed the eth-sendrawtransaction-line-count-integration branch from b8464d7 to 52b6531 Compare April 10, 2024 10:59
@fab-10 fab-10 force-pushed the eth-sendrawtransaction-line-count-integration branch from 52b6531 to 201e5fd Compare April 10, 2024 14:09
@fab-10 fab-10 marked this pull request as ready for review April 10, 2024 14:09
@fab-10 fab-10 changed the title Reject a tx, sent via eth_sendRawTransaction, if its simulation fails In the txpool, reject a tx if its simulation fails Apr 10, 2024
fab-10 added 2 commits April 10, 2024 18:55
# Conflicts:
#	arithmetization/src/main/java/net/consensys/linea/AbstractLineaSharedOptionsPlugin.java
#	arithmetization/src/main/java/net/consensys/linea/rpc/linea/LineaEstimateGas.java
#	arithmetization/src/main/java/net/consensys/linea/sequencer/modulelimit/ModuleLimitsValidationResult.java
Signed-off-by: Fabio Di Fabio <[email protected]>
Copy link
Collaborator

@Gabriel-Trintinalia Gabriel-Trintinalia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. PR is pretty straightforward. Some minor nits

@fab-10 fab-10 force-pushed the eth-sendrawtransaction-line-count-integration branch from 0b7f9db to 9cbd5d1 Compare April 11, 2024 12:56
Signed-off-by: Fabio Di Fabio <[email protected]>
@fab-10 fab-10 force-pushed the eth-sendrawtransaction-line-count-integration branch from 9cbd5d1 to 88a814a Compare April 11, 2024 13:00
@fab-10 fab-10 merged commit 8e3fce7 into main Apr 11, 2024
7 checks passed
@fab-10 fab-10 deleted the eth-sendrawtransaction-line-count-integration branch April 11, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants