Skip to content

Add FILTER_TRANSACTION_NOT_FOUND error#1681

Merged
lorisleiva merged 3 commits into
anza-xyz:mainfrom
brooksprumo:filter-transaction-not-found
May 21, 2026
Merged

Add FILTER_TRANSACTION_NOT_FOUND error#1681
lorisleiva merged 3 commits into
anza-xyz:mainfrom
brooksprumo:filter-transaction-not-found

Conversation

@brooksprumo
Copy link
Copy Markdown
Contributor

Problem

When working on #1679, I noticed Kit was a missing json rpc error. It was added to agave in anza-xyz/agave#7937.

Summary of Changes

Add it to Kit.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

🦋 Changeset detected

Latest commit: 2ea6a1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 47 packages
Name Type
@solana/errors Patch
@solana/accounts Patch
@solana/addresses Patch
@solana/assertions Patch
@solana/codecs-core Patch
@solana/codecs-data-structures Patch
@solana/codecs-numbers Patch
@solana/codecs-strings Patch
@solana/compat Patch
@solana/fixed-points Patch
@solana/instruction-plans Patch
@solana/instructions Patch
@solana/keys Patch
@solana/kit Patch
@solana/offchain-messages Patch
@solana/options Patch
@solana/program-client-core Patch
@solana/programs Patch
@solana/react Patch
@solana/rpc-api Patch
@solana/rpc-spec Patch
@solana/rpc-subscriptions-channel-websocket Patch
@solana/rpc-subscriptions-spec Patch
@solana/rpc-subscriptions Patch
@solana/rpc-transformers Patch
@solana/rpc-transport-http Patch
@solana/rpc-types Patch
@solana/rpc Patch
@solana/signers Patch
@solana/subscribable Patch
@solana/sysvars Patch
@solana/transaction-confirmation Patch
@solana/transaction-messages Patch
@solana/transactions Patch
@solana/wallet-account-signer Patch
@solana/plugin-interfaces Patch
@solana/rpc-graphql Patch
@solana/rpc-parsed-types Patch
@solana/rpc-subscriptions-api Patch
@solana/codecs Patch
@solana/fast-stable-stringify Patch
@solana/functional Patch
@solana/nominal-types Patch
@solana/plugin-core Patch
@solana/promises Patch
@solana/rpc-spec-types Patch
@solana/webcrypto-ed25519-polyfill Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bundlemon
Copy link
Copy Markdown

bundlemon Bot commented May 21, 2026

BundleMon

Files updated (7)
Status Path Size Limits
errors/dist/index.browser.mjs
20.58KB (+40B +0.19%) -
errors/dist/index.native.mjs
20.58KB (+40B +0.19%) -
errors/dist/index.node.mjs
20.61KB (+40B +0.19%) -
wallet-account-signer/dist/index.browser.mjs
17.41KB (+27B +0.15%) -
wallet-account-signer/dist/index.native.mjs
17.41KB (+26B +0.15%) -
wallet-account-signer/dist/index.node.mjs
17.43KB (+25B +0.14%) -
@solana/kit production bundle
kit/dist/index.production.min.js
52.3KB (+20B +0.04%) -
Unchanged files (140)
Status Path Size Limits
rpc-graphql/dist/index.browser.mjs
18.82KB -
rpc-graphql/dist/index.native.mjs
18.81KB -
rpc-graphql/dist/index.node.mjs
18.81KB -
transaction-messages/dist/index.browser.mjs
11.32KB -
transaction-messages/dist/index.native.mjs
11.32KB -
transaction-messages/dist/index.node.mjs
11.32KB -
instruction-plans/dist/index.browser.mjs
6.58KB -
instruction-plans/dist/index.native.mjs
6.58KB -
instruction-plans/dist/index.node.mjs
6.58KB -
fixed-points/dist/index.browser.mjs
5.08KB -
fixed-points/dist/index.native.mjs
5.07KB -
fixed-points/dist/index.node.mjs
5.07KB -
codecs-data-structures/dist/index.browser.mjs
5.04KB -
codecs-data-structures/dist/index.native.mjs
5.03KB -
codecs-data-structures/dist/index.node.mjs
5.03KB -
offchain-messages/dist/index.browser.mjs
4.89KB -
offchain-messages/dist/index.native.mjs
4.89KB -
offchain-messages/dist/index.node.mjs
4.89KB -
transactions/dist/index.browser.mjs
4.07KB -
transactions/dist/index.native.mjs
4.07KB -
transactions/dist/index.node.mjs
4.07KB -
kit/dist/index.browser.mjs
3.97KB -
kit/dist/index.native.mjs
3.97KB -
kit/dist/index.node.mjs
3.97KB -
codecs-core/dist/index.browser.mjs
3.62KB -
codecs-core/dist/index.native.mjs
3.62KB -
codecs-core/dist/index.node.mjs
3.62KB -
webcrypto-ed25519-polyfill/dist/index.node.mj
s
3.61KB -
webcrypto-ed25519-polyfill/dist/index.browser
.mjs
3.59KB -
webcrypto-ed25519-polyfill/dist/index.native.
mjs
3.57KB -
rpc-subscriptions/dist/index.browser.mjs
3.37KB -
rpc-subscriptions/dist/index.node.mjs
3.34KB -
rpc-subscriptions/dist/index.native.mjs
3.31KB -
signers/dist/index.browser.mjs
3.26KB -
signers/dist/index.native.mjs
3.26KB -
signers/dist/index.node.mjs
3.26KB -
rpc-transformers/dist/index.browser.mjs
3.16KB -
rpc-transformers/dist/index.native.mjs
3.16KB -
rpc-transformers/dist/index.node.mjs
3.16KB -
react/dist/index.browser.mjs
3.09KB -
react/dist/index.native.mjs
3.09KB -
react/dist/index.node.mjs
3.09KB -
keys/dist/index.node.mjs
3.06KB -
addresses/dist/index.browser.mjs
2.93KB -
addresses/dist/index.native.mjs
2.92KB -
addresses/dist/index.node.mjs
2.92KB -
keys/dist/index.browser.mjs
2.85KB -
keys/dist/index.native.mjs
2.85KB -
subscribable/dist/index.node.mjs
2.68KB -
subscribable/dist/index.native.mjs
2.61KB -
subscribable/dist/index.browser.mjs
2.6KB -
codecs-strings/dist/index.browser.mjs
2.55KB -
codecs-strings/dist/index.node.mjs
2.51KB -
codecs-strings/dist/index.native.mjs
2.47KB -
transaction-confirmation/dist/index.node.mjs
2.42KB -
transaction-confirmation/dist/index.native.mj
s
2.37KB -
sysvars/dist/index.browser.mjs
2.37KB -
sysvars/dist/index.native.mjs
2.37KB -
transaction-confirmation/dist/index.browser.m
js
2.37KB -
sysvars/dist/index.node.mjs
2.37KB -
rpc-subscriptions-spec/dist/index.node.mjs
2.25KB -
rpc-subscriptions-spec/dist/index.native.mjs
2.2KB -
rpc-subscriptions-spec/dist/index.browser.mjs
2.2KB -
rpc/dist/index.node.mjs
1.95KB -
codecs-numbers/dist/index.browser.mjs
1.95KB -
codecs-numbers/dist/index.native.mjs
1.95KB -
codecs-numbers/dist/index.node.mjs
1.94KB -
rpc-transport-http/dist/index.browser.mjs
1.91KB -
rpc-transport-http/dist/index.native.mjs
1.9KB -
rpc/dist/index.native.mjs
1.81KB -
rpc-types/dist/index.browser.mjs
1.8KB -
rpc/dist/index.browser.mjs
1.8KB -
rpc-types/dist/index.native.mjs
1.8KB -
rpc-types/dist/index.node.mjs
1.8KB -
rpc-transport-http/dist/index.node.mjs
1.72KB -
rpc-subscriptions-channel-websocket/dist/inde
x.node.mjs
1.33KB -
rpc-subscriptions-channel-websocket/dist/inde
x.native.mjs
1.27KB -
rpc-subscriptions-channel-websocket/dist/inde
x.browser.mjs
1.26KB -
program-client-core/dist/index.browser.mjs
1.21KB -
program-client-core/dist/index.native.mjs
1.21KB -
program-client-core/dist/index.node.mjs
1.21KB -
options/dist/index.browser.mjs
1.18KB -
options/dist/index.native.mjs
1.18KB -
options/dist/index.node.mjs
1.17KB -
accounts/dist/index.browser.mjs
1.17KB -
accounts/dist/index.native.mjs
1.17KB -
accounts/dist/index.node.mjs
1.16KB -
rpc-api/dist/index.browser.mjs
998B -
rpc-api/dist/index.native.mjs
997B -
rpc-api/dist/index.node.mjs
995B -
compat/dist/index.browser.mjs
969B -
compat/dist/index.native.mjs
968B -
compat/dist/index.node.mjs
966B -
rpc-spec-types/dist/index.browser.mjs
962B -
rpc-spec-types/dist/index.native.mjs
961B -
rpc-spec-types/dist/index.node.mjs
959B -
rpc-spec/dist/index.browser.mjs
918B -
rpc-spec/dist/index.native.mjs
918B -
rpc-spec/dist/index.node.mjs
917B -
rpc-subscriptions-api/dist/index.native.mjs
870B -
rpc-subscriptions-api/dist/index.node.mjs
869B -
rpc-subscriptions-api/dist/index.browser.mjs
868B -
promises/dist/index.native.mjs
841B -
promises/dist/index.node.mjs
840B -
promises/dist/index.browser.mjs
839B -
plugin-core/dist/index.browser.mjs
820B -
plugin-core/dist/index.native.mjs
819B -
plugin-core/dist/index.node.mjs
817B -
assertions/dist/index.browser.mjs
783B -
instructions/dist/index.browser.mjs
771B -
instructions/dist/index.native.mjs
770B -
instructions/dist/index.node.mjs
768B -
fast-stable-stringify/dist/index.browser.mjs
726B -
fast-stable-stringify/dist/index.native.mjs
725B -
assertions/dist/index.native.mjs
724B -
fast-stable-stringify/dist/index.node.mjs
724B -
assertions/dist/index.node.mjs
723B -
programs/dist/index.browser.mjs
329B -
programs/dist/index.native.mjs
327B -
programs/dist/index.node.mjs
325B -
fs-impl/dist/index.browser.mjs
245B -
event-target-impl/dist/index.node.mjs
230B -
functional/dist/index.browser.mjs
154B -
functional/dist/index.native.mjs
152B -
text-encoding-impl/dist/index.native.mjs
152B -
functional/dist/index.node.mjs
151B -
codecs/dist/index.browser.mjs
145B -
codecs/dist/index.native.mjs
144B -
codecs/dist/index.node.mjs
142B -
event-target-impl/dist/index.browser.mjs
133B -
ws-impl/dist/index.node.mjs
131B -
text-encoding-impl/dist/index.browser.mjs
122B -
fs-impl/dist/index.node.mjs
120B -
text-encoding-impl/dist/index.node.mjs
119B -
ws-impl/dist/index.browser.mjs
113B -
crypto-impl/dist/index.node.mjs
111B -
crypto-impl/dist/index.browser.mjs
109B -
rpc-parsed-types/dist/index.browser.mjs
66B -
rpc-parsed-types/dist/index.native.mjs
65B -
rpc-parsed-types/dist/index.node.mjs
63B -

Total files change +218B +0.04%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Copy Markdown
Contributor Author

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

I also saw that a changeset was added to #1679, but I haven't done that here yet.

[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET]: '$__serverMessage',
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_EPOCH_REWARDS_PERIOD_ACTIVE]:
'Epoch rewards period still active at slot $slot',
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND]: '$__serverMessage',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure what to put here, so guessed based on similar json rpc errors that contained a String message and no data (e.g. KEY_EXCLUDED_FROM_SECONDARY_INDEX). Please double check 😸

@brooksprumo
Copy link
Copy Markdown
Contributor Author

@lorisleiva @joncinque - tagging y'all again for a review request. Thanks in advance!

@lorisleiva lorisleiva self-requested a review May 21, 2026 12:57
Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

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

Thanks! IIRC, you need to add this error code here to add the server message in the context:

case SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR:
case SOLANA_ERROR__JSON_RPC__INVALID_PARAMS:
case SOLANA_ERROR__JSON_RPC__INVALID_REQUEST:
case SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND:
case SOLANA_ERROR__JSON_RPC__PARSE_ERROR:
case SOLANA_ERROR__JSON_RPC__SCAN_ERROR:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:
case SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:
// The server supplies no structured data, but rather a pre-formatted message. Put
// the server message in `context` so as not to completely lose the data. The long
// term fix for this is to add data to the server responses and modify the
// messages in `@solana/errors` to be actual format strings.
errorContext = { __serverMessage: message };
break;

@brooksprumo
Copy link
Copy Markdown
Contributor Author

brooksprumo commented May 21, 2026

Oh, I just saw https://github.com/anza-xyz/kit/tree/main/packages/errors/#adding-a-new-error. Should I also add to src/context.ts as well?

Edit: I've added to context.ts.

@brooksprumo brooksprumo requested a review from lorisleiva May 21, 2026 13:37
@brooksprumo brooksprumo force-pushed the filter-transaction-not-found branch from 416f2d8 to 2ea6a1c Compare May 21, 2026 13:39
rewardsCompleteBlockHeight: bigint;
slot: bigint;
};
[SOLANA_ERROR__JSON_RPC__SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND]: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah yeah good shout! I think you've just forgotten to import the constant in this file which is why CI is failing.

Btw, am I right to say your previous error code had no context? That is, no data attached to the error on the RPC server.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, good find. Should be fixed now.

And yes, the error does not have anything in the data field, only the message field.

            RpcCustomError::FilterTransactionNotFound { signature } => Self {
                code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND),
                message: format!("Transaction {signature} not found"),
                data: None,
            },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, did you mean the NO_SLOT_HISTORY error?

            RpcCustomError::NoSlotHistory => Self {
                code: ErrorCode::ServerError(JSON_RPC_SERVER_ERROR_NO_SLOT_HISTORY),
                message: "No slot history".to_string(),
                data: None,
            },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah that's all good then! The server message trick is to ensure we don't loose any dynamic data only present in the error message. In the case of JSON_RPC_SERVER_ERROR_FILTER_TRANSACTION_NOT_FOUND, that's the signature inside the message.

On that note, may I ask why we're not returning that signature as data? Then, consumers could access that signature directly instead of having to parse the error message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On that note, may I ask why we're not returning that signature as data?

No idea. Probably because we didn't know to do that 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Has this change landed already server side? Not a big deal if it has but it would be nice if moving forward we could make sure dynamic error information is provided as data instead of available in the error message only. Ideally we would even retroactively fix these errors (as per the following comment in Kit) but I realise this may be near impossible. ☺️

 // The server supplies no structured data, but rather a pre-formatted message. Put 
 // the server message in `context` so as not to completely lose the data. The long 
 // term fix for this is to add data to the server responses and modify the 
 // messages in `@solana/errors` to be actual format strings.

In any case, LGTM and we can always work on a subsequent PR if the server side can still be changed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like the original agave PR was backported to v4.0, so it is going live now.

Re:

dynamic error information is provided as data instead of available in the error message only

Yes, I agree.

@brooksprumo brooksprumo requested a review from lorisleiva May 21, 2026 13:43
Copy link
Copy Markdown
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

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

Thank you! 🍺

@lorisleiva lorisleiva added this pull request to the merge queue May 21, 2026
Merged via the queue into anza-xyz:main with commit 6b499ee May 21, 2026
11 checks passed
@brooksprumo brooksprumo deleted the filter-transaction-not-found branch May 21, 2026 16:27
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