← Back to Pull requests

refactor(runtime): hardcode formalize_loaded_transaction_data_size #1598

Merged
hamza-syndica merged 4 files (406 lines) on Jun 26, 2026 16:43 UTC
View on GitHub
hamza-syndica hamza-syndica commented on Jun 15, 2026 10:48 UTC
Author

Hardcode formalize_loaded_transaction_data_size feature - confirmed hardcoded in both:

  • Agave: d5757e29aa - remove pre-simd186 account loading (#9271)

  • Firedancer: 17aa6d6a380fcb3e5f4bea697a828d94a608b544
  • Closes #1584

    Diff: 406 lines (+98 / -308) across 4 files Reviewer: ajw221 Review duration: 16194m
    All Vouch review confidence checks passed
    Residual risk 0.11 = Change Risk (0.43) × (1 − Review Confidence (0.74)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 406 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.52 · 4 substantive comment(s)
    0.52
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    74%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.359
    Real PR Conversation Timeline
    9 items
    codecov[bot] codecov[bot] commented on Jun 15, 2026 11:13 UTC
    Bot

    Codecov Report


    :white_check_mark: All modified and coverable lines are covered by tests.
    see 2 files with indirect coverage changes
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • </details>

    ajw221 ajw221 commented on code on Jun 17, 2026 13:42 UTC
    Code Review
    shared/runtime/account_loader.zig:1
    @@ -1249,106 +986,6 @@ test "load, create new account" {
         try std.testing.expectEqual(0, loaded_accounts.accounts.slice()[0].account.lamports);
     }
     
    -test "invalid program owner owner" {
    -    const allocator = std.testing.allocator;
    -    var prng = std.Random.DefaultPrng.init(std.testing.random_seed);
    -    const random = prng.random();
    -    var accountsdb = sig.utils.collections.PubkeyMap(AccountSharedData).empty;
    -    defer accountsdb.deinit(allocator);
    -    const env = newTestingEnv();
    -
    -    const instruction_address = Pubkey.initRandom(random);
    -    const instruction_owner = Pubkey.initRandom(random);
    -    const invalid_owner_owner = Pubkey.initRandom(random);
    -
    -    try accountsdb.put(allocator, instruction_address, .{
    -        .data = &.{},
    -        .lamports = 1,
    -        .executable = true,
    -        .owner = instruction_owner,
    -        .rent_epoch = 0,
    -    });
    -    try accountsdb.put(allocator, instruction_owner, .{
    -        .data = &.{},
    -        .lamports = 1,
    -        .executable = true,
    -        .owner = invalid_owner_owner,
    -        .rent_epoch = 0,
    -    });
    -
    -    var tx = try emptyTxWithKeys(allocator, &.{instruction_address});
    -    defer tx.accounts.deinit(allocator);
    -    tx.instructions = &.{
    -        .{
    -            .program_meta = .{ .pubkey = instruction_address, .index_in_transaction = 0 },
    -            .account_metas = .{},
    -            .dedupe_map = @splat(0xffff),
    -            .instruction_data = "",
    -            .owned_instruction_data = false,
    -            .initial_account_lamports = 0,
    -        },
    -    };
    -
    -    const loaded_accounts_result = loadTransactionAccountsOld(
    -        AccountReader.fromMap(&accountsdb),
    -        allocator,
    -        &tx,
    -        &env.rent_collector,
    -        &env.feature_set,
    -        env.slot,
    -        &env.compute_budget_limits,
    -        .{ .account = AccountSharedData.EMPTY, .loaded_size = 0, .rent_collected = 0 },
    -    );
    -
    -    try std.testing.expectError(error.InvalidProgramForExecution, loaded_accounts_result);
    -}
    -
    -test "missing program owner account" {
    -    const allocator = std.testing.allocator;
    -    var prng = std.Random.DefaultPrng.init(std.testing.random_seed);
    -    const random = prng.random();
    -    var accountsdb = sig.utils.collections.PubkeyMap(AccountSharedData).empty;
    -    defer accountsdb.deinit(allocator);
    -    const env = newTestingEnv();
    -
    -    const instruction_address = Pubkey.initRandom(random);
    -    const instruction_owner = Pubkey.initRandom(random);
    -
    -    try accountsdb.put(allocator, instruction_address, .{
    -        .data = &.{},
    -        .lamports = 1,
    -        .executable = true,
    -        .owner = instruction_owner,
    -        .rent_epoch = 0,
    -    });
    -
    -    var tx = try emptyTxWithKeys(allocator, &.{instruction_address});
    -    defer tx.accounts.deinit(allocator);
    -    tx.instructions = &.{
    -        .{
    -            .program_meta = .{ .pubkey = instruction_address, .index_in_transaction = 0 },
    -            .account_metas = .{},
    -            .dedupe_map = @splat(0xffff),
    -            .instruction_data = "",
    -            .owned_instruction_data = false,
    -            .initial_account_lamports = 0,
    -        },
    -    };
    -
    -    const loaded_accounts_result = loadTransactionAccountsOld(
    -        AccountReader.fromMap(&accountsdb),
    -        allocator,
    -        &tx,
    -        &env.rent_collector,
    -        &env.feature_set,
    -        env.slot,
    -        &env.compute_budget_limits,
    -        .{ .account = AccountSharedData.EMPTY, .loaded_size = 0, .rent_collected = 0 },
    -    );
    -
    -    try std.testing.expectError(error.ProgramAccountNotFound, loaded_accounts_result);
    -}
    -

    these should be updated, not deleted, these tests were covering codepaths for error.ProgramAccountNotFound and error.InvalidProgramForExecution, which still exist in loadTransactionAccountsSimd186

    ajw221 ajw221 requested changes on Jun 17, 2026 13:42 UTC
    Changes Requested Reviewer

    Requested changes.

    hamza-syndica hamza-syndica commented on code on Jun 18, 2026 06:49 UTC
    Code Review
    shared/runtime/account_loader.zig:1
    @@ -1249,106 +986,6 @@ test "load, create new account" {
         try std.testing.expectEqual(0, loaded_accounts.accounts.slice()[0].account.lamports);
     }
     
    -test "invalid program owner owner" {
    -    const allocator = std.testing.allocator;
    -    var prng = std.Random.DefaultPrng.init(std.testing.random_seed);
    -    const random = prng.random();
    -    var accountsdb = sig.utils.collections.PubkeyMap(AccountSharedData).empty;
    -    defer accountsdb.deinit(allocator);
    -    const env = newTestingEnv();
    -
    -    const instruction_address = Pubkey.initRandom(random);
    -    const instruction_owner = Pubkey.initRandom(random);
    -    const invalid_owner_owner = Pubkey.initRandom(random);
    -
    -    try accountsdb.put(allocator, instruction_address, .{
    -        .data = &.{},
    -        .lamports = 1,
    -        .executable = true,
    -        .owner = instruction_owner,
    -        .rent_epoch = 0,
    -    });
    -    try accountsdb.put(allocator, instruction_owner, .{
    -        .data = &.{},
    -        .lamports = 1,
    -        .executable = true,
    -        .owner = invalid_owner_owner,
    -        .rent_epoch = 0,
    -    });
    -
    -    var tx = try emptyTxWithKeys(allocator, &.{instruction_address});
    -    defer tx.accounts.deinit(allocator);
    -    tx.instructions = &.{
    -        .{
    -            .program_meta = .{ .pubkey = instruction_address, .index_in_transaction = 0 },
    -            .account_metas = .{},
    -            .dedupe_map = @splat(0xffff),
    -            .instruction_data = "",
    -            .owned_instruction_data = false,
    -            .initial_account_lamports = 0,
    -        },
    -    };
    -
    -    const loaded_accounts_result = loadTransactionAccountsOld(
    -        AccountReader.fromMap(&accountsdb),
    -        allocator,
    -        &tx,
    -        &env.rent_collector,
    -        &env.feature_set,
    -        env.slot,
    -        &env.compute_budget_limits,
    -        .{ .account = AccountSharedData.EMPTY, .loaded_size = 0, .rent_collected = 0 },
    -    );
    -
    -    try std.testing.expectError(error.InvalidProgramForExecution, loaded_accounts_result);
    -}
    -
    -test "missing program owner account" {
    -    const allocator = std.testing.allocator;
    -    var prng = std.Random.DefaultPrng.init(std.testing.random_seed);
    -    const random = prng.random();
    -    var accountsdb = sig.utils.collections.PubkeyMap(AccountSharedData).empty;
    -    defer accountsdb.deinit(allocator);
    -    const env = newTestingEnv();
    -
    -    const instruction_address = Pubkey.initRandom(random);
    -    const instruction_owner = Pubkey.initRandom(random);
    -
    -    try accountsdb.put(allocator, instruction_address, .{
    -        .data = &.{},
    -        .lamports = 1,
    -        .executable = true,
    -        .owner = instruction_owner,
    -        .rent_epoch = 0,
    -    });
    -
    -    var tx = try emptyTxWithKeys(allocator, &.{instruction_address});
    -    defer tx.accounts.deinit(allocator);
    -    tx.instructions = &.{
    -        .{
    -            .program_meta = .{ .pubkey = instruction_address, .index_in_transaction = 0 },
    -            .account_metas = .{},
    -            .dedupe_map = @splat(0xffff),
    -            .instruction_data = "",
    -            .owned_instruction_data = false,
    -            .initial_account_lamports = 0,
    -        },
    -    };
    -
    -    const loaded_accounts_result = loadTransactionAccountsOld(
    -        AccountReader.fromMap(&accountsdb),
    -        allocator,
    -        &tx,
    -        &env.rent_collector,
    -        &env.feature_set,
    -        env.slot,
    -        &env.compute_budget_limits,
    -        .{ .account = AccountSharedData.EMPTY, .loaded_size = 0, .rent_collected = 0 },
    -    );
    -
    -    try std.testing.expectError(error.ProgramAccountNotFound, loaded_accounts_result);
    -}
    -

    added back that 2 test, sorry had to rebase with main, not a good commit hash to share: https://github.com/Syndica/sig/pull/1598/commits/1142e7cd31443b400f1136d3c632b924b253c53e

    yewman yewman commented on Jun 22, 2026 13:45 UTC
    Reviewer

    Can we rename loadTransactionAccountsSimd186 -> loadTransactionAccounts please?

    hamza-syndica hamza-syndica commented on Jun 22, 2026 14:20 UTC
    Author

    @yewman Renamed to loadTransactionAccountsInner. Can't fully merge into loadTransactionAccounts since the inner function uses try throughout and the wrapper converts those to TransactionResult values - need the separate function boundary for the catch.

    ajw221 ajw221 approved these changes on Jun 26, 2026 15:10 UTC
    Approved Reviewer

    Approved these changes.

    yewman yewman approved these changes on Jun 26, 2026 15:11 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    hamza-syndica hamza-syndica
    Labels
    risk: low confidence: 74.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.3% (MEDIUM) · Higher = larger blast radius
    43.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 74.2% · Lower = rushed or shallow review
    74.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 11.2% · Safe to merge
    11.2%
    Repository