Skip to content

rfc19-user-bgp-status#3037

Merged
juan-malbeclabs merged 4 commits intomainfrom
jo/rfc-user-bgp-status
Apr 6, 2026
Merged

rfc19-user-bgp-status#3037
juan-malbeclabs merged 4 commits intomainfrom
jo/rfc-user-bgp-status

Conversation

@juan-malbeclabs
Copy link
Copy Markdown
Contributor

This pull request introduces RFC 17, which proposes a new onchain mechanism to track the real BGP session status for each user, closing the gap between configuration and actual client connectivity. The RFC details new fields to be added to the User account, a new instruction for updating BGP status, and changes to telemetry collection and SDKs. This enhancement will enable more accurate diagnostics and user lifecycle management by making BGP session state observable onchain.

User account and onchain status tracking:

  • Adds three new fields to the User struct: bgp_status (session state), last_bgp_up_at (last time session was Up), and last_bgp_reported_at (last time status changed), requiring a 17-byte account reallocation on first write.
  • Introduces a new instruction, SetUserBGPStatus, allowing authorized metrics publishers to update BGP status for each user, with strict validation.

Telemetry and agent changes:

  • Updates the telemetry collector to determine each user's BGP state after every collection tick and enqueue onchain status updates via the new instruction, using a background worker for reliability.

SDK and compatibility:

  • Requires updates to SDKs (Go, TypeScript, Python) to handle the new fields, ensuring backward compatibility by treating missing fields as

Comment thread rfcs/rfc17-user-bgp-status.md Outdated
@ben-dz
Copy link
Copy Markdown
Contributor

ben-dz commented Mar 5, 2026

I think overall DZDs should be using their telemetry key to write this data onchain. I don't think we want this as part of the onchain user, since I think we don't want to give DZDs the authority to modify user accounts.

instead, probably a separate onchain program (bgp-monitor?) that maintains this data. Eventually perhaps add a cross-program call to have the bgp-monitor call into serviceability to delete users when uploaded data shows stale sessions.

@juan-malbeclabs
Copy link
Copy Markdown
Contributor Author

We would be creating an instruction that can be executed by the agent using the telemetry PK, which is only allowed to update this field in the user account. It does not have permission to modify any other fields. Additionally, it internally sets the slot values.

New instruction: SetUserBGPStatus (variant 94)

Copy link
Copy Markdown
Contributor

@ben-malbeclabs ben-malbeclabs left a comment

Choose a reason for hiding this comment

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

Approved from a conceptual perspective, would be good to have another dev confirm too.

Comment thread rfcs/rfc17-user-bgp-status.md Outdated
Comment thread rfcs/rfc17-user-bgp-status.md Outdated
Comment thread rfcs/rfc19-user-bgp-status.md
Comment thread rfcs/rfc17-user-bgp-status.md Outdated
Comment thread rfcs/rfc17-user-bgp-status.md Outdated
Comment thread rfcs/rfc19-user-bgp-status.md
@juan-malbeclabs juan-malbeclabs force-pushed the jo/rfc-user-bgp-status branch from c43c227 to 738bdc5 Compare March 19, 2026 02:45
@juan-malbeclabs juan-malbeclabs changed the title rfc17-user-bgp-status rfc19-user-bgp-status Apr 6, 2026
- last_bgp_reported_at updated on every write (not only on transitions)
- telemetry agent writes on state change or after periodic refresh interval (~1h)
- removed user.status == Activated validation constraint
- instruction variant changed from 94 to TBD (94-103 are taken)
- expanded UserBGPSession alternative with rejection rationale
- removed resolved open question about periodic reconfirmation writes
@juan-malbeclabs juan-malbeclabs force-pushed the jo/rfc-user-bgp-status branch from 8979999 to f26b906 Compare April 6, 2026 12:49
@juan-malbeclabs juan-malbeclabs merged commit 274eab0 into main Apr 6, 2026
33 checks passed
@juan-malbeclabs juan-malbeclabs deleted the jo/rfc-user-bgp-status branch April 6, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants