Skip to content

p2p: added functionality to temporarily ban peers to prevent connections#1922

Merged
pratikspatil024 merged 2 commits intodevelopfrom
psp-pos-3344
Dec 9, 2025
Merged

p2p: added functionality to temporarily ban peers to prevent connections#1922
pratikspatil024 merged 2 commits intodevelopfrom
psp-pos-3344

Conversation

@pratikspatil024
Copy link
Copy Markdown
Member

@pratikspatil024 pratikspatil024 commented Dec 9, 2025

Description

This PR implements P2P Layer Jailing functionality which blocks outbound/inbound connections.

We do not jail peers here, that can be done later, this PR just makes it possible. For example, in #1766, this will be used to jail the peer which fails the p2p consensus.

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@pratikspatil024 pratikspatil024 requested a review from a team December 9, 2025 05:10
Copy link
Copy Markdown
Member

@kamuikatsurgi kamuikatsurgi left a comment

Choose a reason for hiding this comment

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

nits

@pratikspatil024 pratikspatil024 merged commit 9ba8a6b into develop Dec 9, 2025
7 of 9 checks passed
@pratikspatil024 pratikspatil024 deleted the psp-pos-3344 branch December 9, 2025 08:30
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Dec 9, 2025

lucca30 added a commit that referenced this pull request Dec 17, 2025
* Revert recorded write operations when tx fails

* Revert selfdestruct on failure

* Added test for selfdestruct revert write

* Add HasSelfDestructed check when applying to final db

* p2p: added functionality to temporarily ban peers to prevent connections (#1922)

* p2p: added functionality to temporarily ban peers to prevent connections

* p2p: cleanup

* chore: bump kurtosis-pos (#1923)

* chore: bump kurtosis-pos

* chore: nits

* chore: install go

* fix(miner): delete pending task after successful block sealing to prevent node stall (#1929)

* fix(miner): delete pending task after successful block sealing to prevent node stall

* chore: nits

* chore: set staleThreshold to 0

* chore: update comment

* Remove Recommit and Fix Parent Actual Time track on Prepare (#1938)

* remove recommit and track parent actual time

* applying pr comments

* fix actual time cache store place

* chore: update deps (#1939)

chore: update deps

* bump version

* bump version

* stable version

---------

Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>
@lucca30 lucca30 mentioned this pull request Dec 17, 2025
18 tasks
pratikspatil024 added a commit that referenced this pull request Dec 18, 2025
* bump version

* stable version

* V2.5.6 candidate (#1941)

* Revert recorded write operations when tx fails

* Revert selfdestruct on failure

* Added test for selfdestruct revert write

* Add HasSelfDestructed check when applying to final db

* p2p: added functionality to temporarily ban peers to prevent connections (#1922)

* p2p: added functionality to temporarily ban peers to prevent connections

* p2p: cleanup

* chore: bump kurtosis-pos (#1923)

* chore: bump kurtosis-pos

* chore: nits

* chore: install go

* fix(miner): delete pending task after successful block sealing to prevent node stall (#1929)

* fix(miner): delete pending task after successful block sealing to prevent node stall

* chore: nits

* chore: set staleThreshold to 0

* chore: update comment

* Remove Recommit and Fix Parent Actual Time track on Prepare (#1938)

* remove recommit and track parent actual time

* applying pr comments

* fix actual time cache store place

* chore: update deps (#1939)

chore: update deps

* bump version

* bump version

* stable version

---------

Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>

* Unstuck

* Added block range check

* bump version 2.5.7

* bump to 2.5.6-beta3

---------

Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>
kamuikatsurgi added a commit that referenced this pull request Dec 18, 2025
…block building work (#1943)

* bump version

* stable version

* V2.5.6 candidate (#1941)

* Revert recorded write operations when tx fails

* Revert selfdestruct on failure

* Added test for selfdestruct revert write

* Add HasSelfDestructed check when applying to final db

* p2p: added functionality to temporarily ban peers to prevent connections (#1922)

* p2p: added functionality to temporarily ban peers to prevent connections

* p2p: cleanup

* chore: bump kurtosis-pos (#1923)

* chore: bump kurtosis-pos

* chore: nits

* chore: install go

* fix(miner): delete pending task after successful block sealing to prevent node stall (#1929)

* fix(miner): delete pending task after successful block sealing to prevent node stall

* chore: nits

* chore: set staleThreshold to 0

* chore: update comment

* Remove Recommit and Fix Parent Actual Time track on Prepare (#1938)

* remove recommit and track parent actual time

* applying pr comments

* fix actual time cache store place

* chore: update deps (#1939)

chore: update deps

* bump version

* bump version

* stable version

---------

Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>

* fix: add pendingWorkBlock to prevent duplicate work

* fix: if check

* nit: comment

* chore: bump version

* chore: add pending work check in new head event as well

* chore: read veblop timeout

---------

Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>
Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
pratikspatil024 added a commit that referenced this pull request Jan 8, 2026
* bump version

* Revert "V2.5.6 candidate (#1941)"

This reverts commit 85b5ef7.

* fix: ignore invalid signer error for specific block range (#1944)

* bump version

* stable version

* V2.5.6 candidate (#1941)

* Revert recorded write operations when tx fails

* Revert selfdestruct on failure

* Added test for selfdestruct revert write

* Add HasSelfDestructed check when applying to final db

* p2p: added functionality to temporarily ban peers to prevent connections (#1922)

* p2p: added functionality to temporarily ban peers to prevent connections

* p2p: cleanup

* chore: bump kurtosis-pos (#1923)

* chore: bump kurtosis-pos

* chore: nits

* chore: install go

* fix(miner): delete pending task after successful block sealing to prevent node stall (#1929)

* fix(miner): delete pending task after successful block sealing to prevent node stall

* chore: nits

* chore: set staleThreshold to 0

* chore: update comment

* Remove Recommit and Fix Parent Actual Time track on Prepare (#1938)

* remove recommit and track parent actual time

* applying pr comments

* fix actual time cache store place

* chore: update deps (#1939)

chore: update deps

* bump version

* bump version

* stable version

---------

Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>

* Unstuck

* Added block range check

* bump version 2.5.7

* bump to 2.5.6-beta3

---------

Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>

* fix(miner): track pending work using block number to avoid duplicate block building work (#1943)

* bump version

* stable version

* V2.5.6 candidate (#1941)

* Revert recorded write operations when tx fails

* Revert selfdestruct on failure

* Added test for selfdestruct revert write

* Add HasSelfDestructed check when applying to final db

* p2p: added functionality to temporarily ban peers to prevent connections (#1922)

* p2p: added functionality to temporarily ban peers to prevent connections

* p2p: cleanup

* chore: bump kurtosis-pos (#1923)

* chore: bump kurtosis-pos

* chore: nits

* chore: install go

* fix(miner): delete pending task after successful block sealing to prevent node stall (#1929)

* fix(miner): delete pending task after successful block sealing to prevent node stall

* chore: nits

* chore: set staleThreshold to 0

* chore: update comment

* Remove Recommit and Fix Parent Actual Time track on Prepare (#1938)

* remove recommit and track parent actual time

* applying pr comments

* fix actual time cache store place

* chore: update deps (#1939)

chore: update deps

* bump version

* bump version

* stable version

---------

Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>

* fix: add pendingWorkBlock to prevent duplicate work

* fix: if check

* nit: comment

* chore: bump version

* chore: add pending work check in new head event as well

* chore: read veblop timeout

---------

Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>
Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>

* chore: bump version to v2.5.6-beta4

* fix(rpc): maxFeePerGas and maxPriorityFeePerGas for StateSyncTx type (#1952)

* Fix missing chain validator service setup (#1957)

* eth/protocols/wit: made protocol version consistent (#1940)

* eth: add missing checker initialization

* core: add log when verifyPendingHeaders is skipped

* Revert "eth/protocols/wit: made protocol version consistent (#1940)"

This reverts commit c98a00e.

---------

Co-authored-by: Pratik Patil <pratikspatil024@gmail.com>

* fix(api): traceBlock (#1959)

* Revert "Merge branch 'master' into v2.5.6-candidate"

This reverts commit 809b189, reversing
changes made to 1dbae9d.

* version bump to v2.5.6-beta5

* Dandeli HF: modify block gas target calculations (#1968)

* remove baseFee validation after hf

* remove logs

* params, consensus: use target gas percentage for base fee calculations

* cleanup

* add comments

* consensus/misc/eip1559: add tests for untitled HF

* typo

* test fixes

* update HF name to dandeli

* simplify

* update gas target to 65%, fix tests

* update comment

* fix tests

* fix tests

* fix tests

* schedule dandeli HF for amoy at block 31890000

* fix lint

* add missing madhugiripro HF in amoy genesis

---------

Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>

* params: bump version to v2.5.6-beta6

* Update DandeliBlock HF for mainnet and bump version

---------

Co-authored-by: Lucca Martins <lucca_martins30@yahoo.com.br>
Co-authored-by: Angel Valkov <avalkov@polygon.technology>
Co-authored-by: Marcello Ardizzone <marcelloardizzone@hotmail.it>
Co-authored-by: Krishang <109511742+kamuikatsurgi@users.noreply.github.com>
Co-authored-by: kamuikatsurgi <shahkrishang11@gmail.com>
Co-authored-by: Raneet Debnath <35629432+Raneet10@users.noreply.github.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Jerry <jerrycgh@gmail.com>
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.

5 participants