Skip to content

Feature/agave - #33

Open
hundredark wants to merge 6 commits into
mainfrom
feature/agave4.2
Open

hundredark wants to merge 6 commits into
mainfrom
feature/agave4.2

Conversation

@hundredark

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical issues in simulation handling, cleanup resource validation, and mixed-version compatibility can halt observers, leave funds unreturned, or cause divergent validator state transitions.

7 open issues
What changed in this PR

Updates Computer’s Solana integration for the v1 transaction format, while retaining support for verifying legacy cleanup transactions.

Changes:

  • Builds v1 transactions with simulated resource limits and capped priority fees.
  • Adds version-aware wire validation and legacy-compatible cleanup comparison.
  • Uses base64 RPC encoding, retries fee queries, and avoids mint collisions in tests.
File Description
solana/​system_call.go Updates cleanup comparison and validates decoded transactions.
solana/​solana.go Separates cleanup construction from version-preserving verification.
solana/​solana_test.go Generates a fresh mint account for the creation test.
solana/​request.go Adds wire validation for attached post-process transactions.
solana/​observer.go Applies wire validation to signed calls before submission.
apps/​solana/​transaction.go Adds v1 resource estimation, fee calculation, and reusable builders.
apps/​solana/​rpc.go Adds bounded fee-query retries and base64 transaction encoding.
apps/​solana/​common.go Adds version-specific size limits and message, signature-slot, and resource validation.

Review effort: Max

Comment on lines +289 to +291
err = c.configureV1TransactionBuilder(ctx, builder)
if err != nil {
return nil, err
Comment on lines +495 to +500
// Keep the transaction's real blockhash. Replacing it during simulation
// breaks durable-nonce transactions because the nonce advance must match it.
simulation, err := c.rpcClient.SimulateTransactionWithOpts(ctx, tx, &rpc.SimulateTransactionOpts{
SigVerify: false,
Commitment: rpc.CommitmentProcessed,
})
if *simulation.Value.LoadedAccountsDataSize == 0 {
return solana.TransactionConfig{}, fmt.Errorf("solana.SimulateTransaction() => loaded accounts data size is zero")
}
computeUnitLimit := getComputeUnitLimit(*simulation.Value.UnitsConsumed)
Comment thread solana/request.go
if err != nil {
return fmt.Errorf("invalid post call transaction: %v", err)
}
err = solanaApp.ValidateWireTransaction(tx)
Comment thread solana/solana.go
case solana.MessageVersionV0:
builder.SetVersion(solana.MessageVersionV0)
case solana.MessageVersionV1:
builder.SetTransactionConfig(comparison.Message.TransactionConfig)
Comment thread solana/system_call.go
Comment on lines +388 to +390
expected = node.createPostProcessTransaction(ctx, main, nonce, nil, nil, actual)
case store.CallTypePrepare:
expected = node.CreateRefundWithdrawalTransaction(ctx, call, main, nonce)
expected = node.createRefundWithdrawalTransaction(ctx, call, main, nonce, actual)
Comment on lines 501 to +502
if err != nil {
panic(err)
return solana.TransactionConfig{}, fmt.Errorf("solana.SimulateTransaction() => %w", err)
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.

2 participants