Skip to content

restore: snapct handling peer ip:port duplicates#8494

Draft
jvarela-jump wants to merge 2 commits intomainfrom
jvarela/snapct-ip-port-dup
Draft

restore: snapct handling peer ip:port duplicates#8494
jvarela-jump wants to merge 2 commits intomainfrom
jvarela/snapct-ip-port-dup

Conversation

@jvarela-jump
Copy link
Contributor

Handling cases where gossip peers advertise duplicate ip:port.

Copilot AI review requested due to automatic review settings February 26, 2026 17:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements duplicate IP:port detection for gossip peers in the snapshot control (snapct) tile. The changes prevent multiple peers from advertising the same RPC address, which could cause conflicts in the peer selection and connection logic.

Changes:

  • Added gossip_addr_is_duplicate function to check if an address is already in use by configured servers or other gossip peers
  • Modified gossip contact info handling to detect and reject duplicate RPC addresses with appropriate warning logs
  • Updated logging to use the entry's actual address (which may be 0 if rejected) instead of the advertised address
  • Removed the FIXME comment about making the code more strict about duplicate IP:port's, as this functionality is now implemented

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.074497 s 0.074566 s 0.093%
backtest mainnet-368528500-perf snapshot load 4.642 s 3.189 s -31.301%
backtest mainnet-368528500-perf total elapsed 74.497342 s 74.565949 s 0.092%
firedancer mem usage with mainnet.toml 972.26 GiB 972.26 GiB 0.000%

@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from 815d0a3 to 45b3dad Compare February 26, 2026 19:20
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.074636 s 0.074419 s -0.291%
backtest mainnet-368528500-perf snapshot load 4.635 s 3.34 s -27.940%
backtest mainnet-368528500-perf total elapsed 74.636226 s 74.418971 s -0.291%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should not insert a new entry for a duplicate gossip rpc address...

Copilot AI review requested due to automatic review settings February 26, 2026 20:23
@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from 9b3c9d3 to 81129fc Compare February 26, 2026 20:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.071566 s 0.071873 s 0.429%
backtest mainnet-368528500-perf snapshot load 3.633 s 3.214 s -11.533%
backtest mainnet-368528500-perf total elapsed 71.565672 s 71.873331 s 0.430%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from 81129fc to 4dfe12b Compare February 26, 2026 20:47
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.074491 s 0.074553 s 0.083%
backtest mainnet-368528500-perf snapshot load 4.661 s 3.22 s -30.916%
backtest mainnet-368528500-perf total elapsed 74.490646 s 74.552685 s 0.083%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

Copilot AI review requested due to automatic review settings February 26, 2026 21:12
@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from 4dfe12b to 5df1580 Compare February 26, 2026 21:12
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.071663 s 0.071749 s 0.120%
backtest mainnet-368528500-perf snapshot load 3.65 s 3.331 s -8.740%
backtest mainnet-368528500-perf total elapsed 71.663438 s 71.749068 s 0.119%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from 5df1580 to aa7e28d Compare February 26, 2026 23:35
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.052435 s 0.05228 s -0.296%
backtest mainnet-368528500-perf snapshot load 2.533 s 1.872 s -26.096%
backtest mainnet-368528500-perf total elapsed 52.435457 s 52.279911 s -0.297%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from aa7e28d to 0426540 Compare February 26, 2026 23:38
Copilot AI review requested due to automatic review settings February 26, 2026 23:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.062654 s 0.062968 s 0.501%
backtest mainnet-368528500-perf snapshot load 2.455 s 2.172 s -11.527%
backtest mainnet-368528500-perf total elapsed 62.654419 s 62.968333 s 0.501%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from 0426540 to 70452ed Compare February 26, 2026 23:45
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.062946 s 0.06311 s 0.261%
backtest mainnet-368528500-perf snapshot load 3.439 s 2.268 s -34.051%
backtest mainnet-368528500-perf total elapsed 62.945556 s 63.109711 s 0.261%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

Copilot AI review requested due to automatic review settings February 27, 2026 00:01
@jvarela-jump jvarela-jump force-pushed the jvarela/snapct-ip-port-dup branch from 70452ed to 1add363 Compare February 27, 2026 00:01
@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.052297 s 0.052361 s 0.122%
backtest mainnet-368528500-perf snapshot load 2.493 s 1.859 s -25.431%
backtest mainnet-368528500-perf total elapsed 52.297163 s 52.360566 s 0.121%
firedancer mem usage with mainnet.toml 986.37 GiB 986.37 GiB 0.000%

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.0526 s 0.052209 s -0.743%
backtest mainnet-368528500-perf snapshot load 2.53 s 1.856 s -26.640%
backtest mainnet-368528500-perf total elapsed 52.599881 s 52.208928 s -0.743%
firedancer mem usage with mainnet.toml 983.37 GiB 983.37 GiB 0.000%

@jvarela-jump jvarela-jump marked this pull request as draft February 27, 2026 16:19
FD_TEST( ULONG_MAX==gossip_ci_map_idx_query_const( ctx->gossip.ci_map, pubkey, ULONG_MAX, ctx->gossip.ci_table ) );
/* If the entry is not allowed, clean the entry entirely, since
it will not be added to the map. */
if( !entry->allowed ) fd_memset( entry, 0, sizeof(gossip_ci_entry_t) );
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm... thinking about this, this means every time a gossip peer that is not allowed is received, then we would have to do the pubkey compare and memset every time?

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.

3 participants