Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cost model for signatures #2315

Open
0x0ece opened this issue Jul 5, 2024 · 0 comments
Open

New cost model for signatures #2315

0x0ece opened this issue Jul 5, 2024 · 0 comments

Comments

@0x0ece
Copy link
Contributor

0x0ece commented Jul 5, 2024

The cost model for signatures changed:
https://github.com/anza-xyz/agave/blob/v2.0.1/cost-model/src/cost_model.rs#L53

vs

for (ushort i = 0; i < txn_descriptor->instr_cnt; ++i)
{
fd_txn_instr_t const *txn_instr = &txn_descriptor->instr[i];
fd_pubkey_t *program_id = &txn_ctx->accounts[txn_instr->program_id];
if (memcmp(program_id->uc, fd_solana_keccak_secp_256k_program_id.key, sizeof(fd_pubkey_t)) == 0 ||
memcmp(program_id->uc, fd_solana_ed25519_sig_verify_program_id.key, sizeof(fd_pubkey_t)) == 0)
{
if (txn_instr->data_sz == 0)
{
continue;
}
uchar *data = (uchar *)txn_raw->raw + txn_instr->data_off;
num_signatures = fd_ulong_sat_add(num_signatures, (ulong)(data[0]));
}
}
double signature_fee = (double)fd_runtime_lamports_per_signature(&txn_ctx->slot_ctx->slot_bank) * (double)num_signatures;

cc @jumpsiegel

@0x0ece 0x0ece self-assigned this Jul 29, 2024
@0x0ece 0x0ece removed their assignment Aug 15, 2024
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

No branches or pull requests

1 participant