Skip to content

Do not save temporary keys in vault; JSON-RPC fix for getTransactions#160

Merged
bvscd merged 2 commits into
release/node/v0.7.0from
vault
May 20, 2026
Merged

Do not save temporary keys in vault; JSON-RPC fix for getTransactions#160
bvscd merged 2 commits into
release/node/v0.7.0from
vault

Conversation

@bvscd
Copy link
Copy Markdown
Collaborator

@bvscd bvscd commented May 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 09:11
@ITBear ITBear self-requested a review May 20, 2026 09:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent ephemeral ADNL handshake keys from being persisted in Secrets Vault (by generating an in-memory Ed25519 key instead). It also includes additional (seemingly unrelated) behavioral changes in the get_transactions RPC handler around handling inconsistent lookup_block_by_lt results and mapping “not found” to a structured ApiError::NotFound.

Changes:

  • Generate a non-vault-backed Ed25519 key for ADNL handshake packets to avoid persisting temporary keys.
  • Add LT-range/account-presence sanity checks in get_transactions, logging warnings and returning partial results where possible.
  • Change the “no transactions found” case in get_transactions to return ApiError::NotFound (404) instead of a generic internal error.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/node/src/rpc_server/handlers.rs Adds additional validation/logging around block lookup by LT and changes “not found” error mapping for get_transactions.
src/adnl/src/adnl/node.rs Switches handshake key generation to Ed25519KeyOption::<ZeroizingBytes>::generate() to avoid Vault persistence.
Comments suppressed due to low confidence (2)

src/node/src/rpc_server/handlers.rs:219

  • This break happens without any warning/logging, while other "lookup returned inconsistent block" branches log a warning before breaking. Adding a log::warn! here (similar to the lt > end_lt case) would make diagnosing inconsistent lookup_block_by_lt results much easier in production.
        let block_info = block_stuff.block()?.read_info()?;
        if lt < block_info.start_lt() {
            break;
        }

src/node/src/rpc_server/handlers.rs:230

  • When lookup_block_by_lt returns an inconsistent block (outside LT range / missing account), the code logs a warning and then exits the loop, which can later surface to the client as a generic NotFound if no transactions were exported. That response can be misleading for a backend/index inconsistency; consider returning an explicit internal error (or a more specific NotFound message) when export is still empty at the point you detect the inconsistency.
        if lt > block_info.end_lt() {
            log::warn!(
                "getTransactions: lookup_block_by_lt returned block outside LT range: \
                address={}, target_lt={lt}, block={block_id}, block_start_lt={}, block_end_lt={}",
                p.address,
                block_info.start_lt(),
                block_info.end_lt(),
            );
            break;
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/node/src/rpc_server/handlers.rs
Comment thread src/node/src/rpc_server/handlers.rs Outdated
@bvscd bvscd changed the title Do not save temporary keys in vault Do not save temporary keys in vault; JSON-RPC fix for getTransactions May 20, 2026
@bvscd bvscd merged commit ff8228e into release/node/v0.7.0 May 20, 2026
6 checks passed
@bvscd bvscd deleted the vault branch May 20, 2026 11:43
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.

3 participants