Skip to content

runtime: add accdb_svm API#9042

Merged
ripatel-fd merged 1 commit intofiredancer-io:mainfrom
riptl:svm-account
Apr 5, 2026
Merged

runtime: add accdb_svm API#9042
ripatel-fd merged 1 commit intofiredancer-io:mainfrom
riptl:svm-account

Conversation

@riptl
Copy link
Copy Markdown
Contributor

@riptl riptl commented Mar 25, 2026

Add API for safer slot boundary account updates. Does automatic
bank lthash and capitalization updates.

Closes #6473

Copilot AI review requested due to automatic review settings March 25, 2026 23:46
Copy link
Copy Markdown
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

Adds a new fd_accdb_svm slot-boundary account update API intended to centralize/standardize LtHash, capture, and capitalization handling, and refactors several runtime call sites to use it.

Changes:

  • Introduces fd_accdb_svm_{open_rw,close_rw,credit,write,remove} helpers for slot boundary account mutations.
  • Refactors sysvar updates, builtin program account writes, incinerator removal, fee settlement, feature activation, and vote-reward crediting to use the new helpers.
  • Wires the new module into the runtime build (Local.mk).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/flamenco/runtime/sysvar/fd_sysvar.c Switch sysvar account writes to fd_accdb_svm_write
src/flamenco/runtime/program/fd_builtin_programs.c Use fd_accdb_svm_write for builtin “bogus executable” accounts
src/flamenco/runtime/fd_runtime.c Use fd_accdb_svm_remove for incinerator and fd_accdb_svm_open_rw/close_rw in fee settlement; use fd_accdb_svm_write for feature activation
src/flamenco/runtime/fd_core_bpf_migration.c Use fd_accdb_svm_open_rw/close_rw in tmp account store
src/flamenco/runtime/fd_accdb_svm.h New public API for slot-boundary account changes
src/flamenco/runtime/fd_accdb_svm.c Implementation of the new slot-boundary helpers (LtHash/capture/cap)
src/flamenco/runtime/Local.mk Adds header + object for the new module
src/flamenco/rewards/fd_rewards.c Use fd_accdb_svm_credit for vote reward crediting and rely on it for cap updates

Comment thread src/flamenco/runtime/sysvar/fd_sysvar.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_runtime.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.h Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_core_bpf_migration.c
Copilot AI review requested due to automatic review settings March 26, 2026 15:30
@riptl riptl force-pushed the svm-account branch 2 times, most recently from 193593e to 0e48563 Compare March 26, 2026 15:36
Copy link
Copy Markdown
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 8 out of 8 changed files in this pull request and generated 7 comments.

Comment thread src/flamenco/runtime/fd_runtime.c
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c
Comment thread src/flamenco/runtime/program/fd_builtin_programs.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.h Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.h
Comment thread src/flamenco/runtime/fd_accdb_svm.c
@ripatel-fd ripatel-fd self-requested a review April 2, 2026 18:16
Copilot AI review requested due to automatic review settings April 2, 2026 18:38
Copy link
Copy Markdown
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 8 out of 8 changed files in this pull request and generated 5 comments.

Comment thread src/flamenco/runtime/fd_runtime.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c
Comment thread src/flamenco/runtime/fd_accdb_svm.c Outdated
Comment thread src/flamenco/runtime/fd_accdb_svm.c
Copilot AI review requested due to automatic review settings April 4, 2026 19:25
Copy link
Copy Markdown
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 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread src/flamenco/runtime/fd_accdb_svm.h
Comment thread src/flamenco/runtime/fd_runtime.c
Comment thread src/flamenco/runtime/fd_accdb_svm.c
Add API for safer slot boundary account updates.  Does automatic
bank lthash and capitalization updates.

Clean up test_settle_fees for maintainability.

Reset execution_fees and priority_fees after distributing fees to
fix re-entrancy issues / double accounting.
Copilot AI review requested due to automatic review settings April 4, 2026 20:02
Copy link
Copy Markdown
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 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread src/flamenco/runtime/fd_accdb_svm.c
Comment thread src/flamenco/runtime/fd_accdb_svm.c
@ripatel-fd ripatel-fd merged commit d0b220b into firedancer-io:main Apr 5, 2026
21 checks passed
@ripatel-fd ripatel-fd deleted the svm-account branch April 5, 2026 23:38
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.

[accdb] svm_account API

4 participants