Repository navigation
Feature/agave - #33
Open
hundredark wants to merge 6 commits into
Open
hundredark wants to merge 6 commits into
hundredark wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
🟡 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
Prepare simulation fails before funding withdrawals are created · New Validate signed transaction size before simulation · New Budget durable-nonce prepares for token account creation · New Avoid panicking on transaction validation errors · New Enforce independent resource limits for v1 cleanups · New Coordinate v1 cleanup activation across validators · New Retry transient simulation RPC errors · New
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) |
| if err != nil { | ||
| return fmt.Errorf("invalid post call transaction: %v", err) | ||
| } | ||
| err = solanaApp.ValidateWireTransaction(tx) |
| case solana.MessageVersionV0: | ||
| builder.SetVersion(solana.MessageVersionV0) | ||
| case solana.MessageVersionV1: | ||
| builder.SetTransactionConfig(comparison.Message.TransactionConfig) |
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.