Skip to content

fix!: Validate public setup fns and gas in p2p#13154

Merged
spalladino merged 2 commits intomasterfrom
palla/gas-phase-validator
Apr 3, 2025
Merged

fix!: Validate public setup fns and gas in p2p#13154
spalladino merged 2 commits intomasterfrom
palla/gas-phase-validator

Conversation

@spalladino
Copy link
Contributor

Adds the phases and gas validators to the p2p client, so txs are checked for valid setup public functions and valid gas (wrt the latest block). This required moving logic from the sequencer to either p2p or stdlib, and injecting a ContractDataSource to the p2p module, in order to validate setup public functions.

Breaking change: SEQ_ALLOWED_SETUP_FN env var is now TX_PUBLIC_SETUP_ALLOWLIST (cc @devrel)

Fixes #10958

@spalladino spalladino requested a review from charlielye as a code owner March 28, 2025 22:01
@spalladino spalladino removed the request for review from charlielye March 28, 2025 22:01
@spalladino spalladino force-pushed the palla/gas-phase-validator branch from 376f480 to a36a4d4 Compare April 3, 2025 12:27
@spalladino spalladino enabled auto-merge April 3, 2025 12:40
@spalladino spalladino added this pull request to the merge queue Apr 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 3, 2025
@spalladino spalladino enabled auto-merge April 3, 2025 13:57
@spalladino spalladino added this pull request to the merge queue Apr 3, 2025
@fcarreiro fcarreiro removed this pull request from the merge queue due to a manual request Apr 3, 2025
@fcarreiro fcarreiro added this pull request to the merge queue Apr 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 3, 2025
spalladino and others added 2 commits April 3, 2025 13:22
Adds the phases and gas validators to the p2p client, so txs are checked
for valid setup public functions and valid gas (wrt the latest block).
This required moving logic from the sequencer to either p2p or stdlib,
and injecting a `ContractDataSource` to the p2p module, in order to
validate setup public functions.

**Breaking change:** `SEQ_ALLOWED_SETUP_FN` env var is now
`TX_PUBLIC_SETUP_ALLOWLIST` (cc @devrel)

Fixes #10958
@spalladino spalladino force-pushed the palla/gas-phase-validator branch from 930f942 to dbf39c4 Compare April 3, 2025 16:22
@spalladino spalladino enabled auto-merge April 3, 2025 16:22
@spalladino spalladino added this pull request to the merge queue Apr 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 3, 2025
@spalladino spalladino added this pull request to the merge queue Apr 3, 2025
Merged via the queue into master with commit 1ef4add Apr 3, 2025
7 checks passed
@spalladino spalladino deleted the palla/gas-phase-validator branch April 3, 2025 22:33
github-merge-queue bot pushed a commit that referenced this pull request Apr 4, 2025
🤖 I have created a new Aztec Packages release
---


##
[0.84.0](v0.83.1...v0.84.0)
(2025-04-04)


### ⚠ BREAKING CHANGES

* `UnsconstrainedContext` --> `UtilityContext`
([#13246](#13246))
* `#[utility]` function
([#13243](#13243))
* Validate public setup fns and gas in p2p
([#13154](#13154))

### Features

* `#[utility]` function
([#13243](#13243))
([945ffa2](945ffa2))
* **avm:** tx hint init
([#13218](#13218))
([60a1a92](60a1a92))
* Remove 4 byte metadata from bb-produced proof
([#13231](#13231))
([0dcc915](0dcc915))
* To enable better ci dashboard.
([#13272](#13272))
([61c6375](61c6375))


### Bug Fixes

* **avm:** fix lookup builder and FF hashing
([#13263](#13263))
([2633856](2633856))
* ci3-external concurrency bug, reduce grind set
([2c5e830](2c5e830)),
closes
[#13285](#13285)
* ci3-external.yml
([#13291](#13291))
([6ad68ed](6ad68ed))
* Validate public setup fns and gas in p2p
([#13154](#13154))
([1ef4add](1ef4add)),
closes
[#10958](#10958)


### Miscellaneous

* `UnsconstrainedContext` --> `UtilityContext`
([#13246](#13246))
([69df86f](69df86f))
* add some PrivateSet tests
([#13270](#13270))
([bd9e690](bd9e690))
* bump full prover test to 32 cores. hoping to boost speed.
([#13293](#13293))
([c8e95dd](c8e95dd))
* deflake p2p reqresp test
([#13271](#13271))
([b9164fa](b9164fa))
* don't dump on fail. click the link instead.
([#13292](#13292))
([ba0fb4d](ba0fb4d))
* flake
([#13277](#13277))
([62c32eb](62c32eb))
* make rahul happy with migration notes
([#13255](#13255))
([3dd75a6](3dd75a6))
* minor simulator utils cleanup
([#13250](#13250))
([8a622c9](8a622c9))
* move a couple of `SharedMutableValues` functions outside of impl
([#13283](#13283))
([df9a40c](df9a40c))
* nuking debug-only logger and various unused functionality in
`foundation`
([#13187](#13187))
([2d38e60](2d38e60))
* prevent eth devnet config contention in ci
([#13260](#13260))
([1581836](1581836))
* renaming unconstrained function as utility in TS
([#13249](#13249))
([34d03bb](34d03bb))
* replace relative paths to noir-protocol-circuits
([b5b99f8](b5b99f8))
* Speed up note hashes test
([#13282](#13282))
([ad23358](ad23358))
* update gov and proposer configs
([#13281](#13281))
([e1a5be3](e1a5be3))
* update slashing test port
([#13274](#13274))
([9a1ddc5](9a1ddc5))
* Want to fail fast on test runs and the wider ci run.
([#13258](#13258))
([f0553b8](f0553b8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
github-merge-queue bot pushed a commit that referenced this pull request Apr 4, 2025
## Overview

Some new flakes have appeared after
#13154 as the
message validation logic was unaware of the skipped state. This resulted
peers dropping transactions with too low gas fees, that could become
valid later.

example failing log:
```
08:06:17 [08:06:17.334] INFO: pxe:service:f4e6b4 Sent transaction 0x290aafc7b7c9c57f409dfb23dff0a42f126e157c640716eb9b56ead6276ab572
08:06:17 [08:06:17.339] INFO: e2e:e2e_p2p:e2e_p2p_rediscovery Tx sent with hash 0x290aafc7b7c9c57f409dfb23dff0a42f126e157c640716eb9b56ead6276ab572
08:06:17 [08:06:17.797] INFO: e2e:e2e_p2p:e2e_p2p_rediscovery Receipt received for 0x290aafc7b7c9c57f409dfb23dff0a42f126e157c640716eb9b56ead6276ab572
08:06:17 [08:06:17.839] WARN: sequencer:tx_validator:tx_gas Skipping transaction 0x290aafc7b7c9c57f409dfb23dff0a42f126e157c640716eb9b56ead6276ab572 due to insufficient fee per gas {"txMaxFeesPerGas":{"feePerDaGas":0,"feePerL2Gas":28890},"currentGasFees":{"feePerDaGas":0,"feePerL2Gas":270010}}
08:06:17 [08:06:17.842] VERBOSE: p2p:peer-scoring Penalizing peer 16Uiu2HAmVSN83RZZYAXjTVvjF1SdcKEnovXNd7wK1SzVRngiwFB4 with HighToleranceError (new score is -2)
08:06:17 [08:06:17.875] WARN: sequencer:tx_validator:tx_gas Skipping transaction 0x290aafc7b7c9c57f409dfb23dff0a42f126e157c640716eb9b56ead6276ab572 due to insufficient fee per gas {"txMaxFeesPerGas":{"feePerDaGas":0,"feePerL2Gas":28890},"currentGasFees":{"feePerDaGas":0,"feePerL2Gas":270010}}
08:06:17 [08:06:17.876] VERBOSE: p2p:peer-scoring Penalizing peer 16Uiu2HAmVSN83RZZYAXjTVvjF1SdcKEnovXNd7wK1SzVRngiwFB4 with HighToleranceError (new score is -2)
08:06:18 [08:06:18.020] WARN: sequencer:tx_validator:tx_gas Skipping transaction 0x290aafc7b7c9c57f409dfb23dff0a42f126e157c640716eb9b56ead6276ab572 due to insufficient fee per gas {"txMaxFeesPerGas":{"feePerDaGas":0,"feePerL2Gas":28890},"currentGasFees":{"feePerDaGas":0,"feePerL2Gas":270010}}
08:06:18 [08:06:18.022] VERBOSE: p2p:peer-scoring Penalizing peer 16Uiu2HAmVSN83RZZYAXjTVvjF1SdcKEnovXNd7wK1SzVRngiwFB4 with HighToleranceError (new score is -2)

```
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.

chore: P2P should validate phases and gas

2 participants