Skip to content

Conversation

anakinzhed
Copy link
Contributor

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Apr 26, 2025

Deploying kolme with  Cloudflare Pages  Cloudflare Pages

Latest commit: c56f28c
Status: ✅  Deploy successful!
Preview URL: https://1c2b1284.kolme.pages.dev
Branch Preview URL: https://kolme-testing-solana.kolme.pages.dev

View logs

@anakinzhed anakinzhed requested a review from Copilot April 26, 2025 16:34
Copy link
Contributor

@Copilot 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 introduces extensive tests for the Kolme Solana Bridge to validate various transaction scenarios and error conditions.

  • Adds tests for invalid payloads, duplicate signatures, replay attacks, and more.
  • Verifies edge cases like self-transfer, insufficient balances, and maximum account limits in instructions.

@anakinzhed anakinzhed changed the title kolme-testing-solana Kolme testing for solana Apr 26, 2025
@anakinzhed anakinzhed marked this pull request as ready for review May 6, 2025 00:04
@anakinzhed anakinzhed requested a review from Copilot May 6, 2025 02:19
Copy link
Contributor

@Copilot 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 introduces a battery of integration tests for the Solana bridge along with a minor configuration update for the BPF target.

  • Added multiple tests to verify payload validation, transfers, duplicate signature rejection, and other behaviors.
  • Updated the entrypoint configuration in lib.rs to conditionally compile for BPF targets.

Reviewed Changes

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

File Description
solana/crates/kolme-solana-bridge/src/tests.rs Adds and updates tests covering various transaction scenarios and error cases.
solana/crates/kolme-solana-bridge/src/lib.rs Adds a target-specific cfg attribute for the entrypoint macro.

@anakinzhed anakinzhed requested a review from Copilot May 6, 2025 02:40
Copy link
Contributor

@Copilot 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 enhances testing for the Solana bridge by adding comprehensive tests covering various edge cases in token transfers and related operations, and updates conditional compilation in the library.

  • Updated error imports (added InitIxError) in tests.
  • Added several new test cases to validate payload handling, transfer scenarios, and error conditions.
  • Adjusted lib.rs to conditionally compile the entrypoint for the BPF target.

Reviewed Changes

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

File Description
solana/crates/kolme-solana-bridge/src/tests.rs Added new tests for transfer, payload validation, edge scenarios, and updated imports.
solana/crates/kolme-solana-bridge/src/lib.rs Added #[cfg(target_arch = "bpf")] to the entrypoint for conditional compilation.

@anakinzhed anakinzhed requested a review from Copilot May 6, 2025 03:32
Copy link
Contributor

@Copilot 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 introduces an extensive suite of tests for the Solana bridge component in the Kolme project to validate transfer, payload, and executor behaviors while also updating error types used in initialization. Key changes include varying tests for scenarios such as invalid payloads, duplicate executor signatures, and self-transfers, as well as a minor update in the library's entrypoint definition for BPF builds.

Reviewed Changes

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

File Description
solana/crates/kolme-solana-bridge/src/tests.rs Added numerous tests covering various transfer and payload failure/success use-cases and updated error type imports.
solana/crates/kolme-solana-bridge/src/lib.rs Added a conditional attribute to ensure the entrypoint is only defined for BPF target builds.

@anakinzhed
Copy link
Contributor Author

anakinzhed commented May 6, 2025

@aakamenov I added this to run the test on Mac.

#[cfg(target_arch = "bpf")]

Otherwise, I get this:

          Undefined symbols for architecture arm64:
            "_sol_log_", referenced from:
                solbox::log::h5351b60a86ca726c in kolme_solana_bridge.14lyqoltyxu0lbdsq38bn1v4x.rcgu.o
            "_sol_log_data", referenced from:
                solbox::log_base64::h594d335a6aa2809f in kolme_solana_bridge.14lyqoltyxu0lbdsq38bn1v4x.rcgu.o
            "_sol_secp256k1_recover", referenced from:
                kolme_solana_bridge::secp256k1_recover::h3c547fff1d5357f0 in kolme_solana_bridge.934y8utf9j9z6c12wa9u5hqru.rcgu.o
            "_sol_sha256", referenced from:
                kolme_solana_bridge::sha256::hb6cdc22ebb760c03 in kolme_solana_bridge.934y8utf9j9z6c12wa9u5hqru.rcgu.o
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Unfortunately the tests don't run successfully. All tests with the same error:

thread 'tests::signed_transfer' panicked at .cargo/registry/src/index.crates.io-6f17d22bba15001f/litesvm-0.6.0/src/lib.rs:700:56:
called `Result::unwrap()` on an `Err` value: Instruction(InvalidAccountData)

@anakinzhed anakinzhed requested a review from aakamenov May 6, 2025 04:14
@anakinzhed anakinzhed requested review from snoyberg and Copilot and removed request for aakamenov May 25, 2025 19:50
Copy link
Contributor

@Copilot 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 adds a suite of tests for the Kolme Solana Bridge to verify various token transfer and error handling scenarios in the Solana environment. Key changes include updates to error handling (e.g. introducing InitIxError), multiple new tests covering edge cases such as duplicate executor signatures, tampered payloads, and various token transfer conditions.

@snoyberg snoyberg requested review from aakamenov and Copilot May 26, 2025 06:13
Copy link
Contributor

@Copilot 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 adds several new tests for the Solana bridge functionality to ensure robust handling of various payload and token transfer scenarios.

  • Update the import to include InitIxError.
  • Add tests for invalid payloads, zero-amount transfers, duplicative executor signatures, large token transfers, insufficient token balance, transfers to uninitialized ATA, multi-token transfers, tampered payloads, invalid executor configurations, and self-transfer.

@anakinzhed anakinzhed removed the request for review from snoyberg May 27, 2025 03:08
@anakinzhed anakinzhed requested a review from Copilot May 27, 2025 03:09
Copy link
Contributor

@Copilot 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 enriches the Solana bridge crate with comprehensive unit tests for various payload and transfer edge cases.

  • Import InitIxError to enable initialization-error tests.
  • Add new tests covering invalid payloads, zero transfers, duplicate signatures, extreme token amounts, insufficient balances, uninitialized accounts, multi-token transfers, tampered payloads, and executor-number validation.
Comments suppressed due to low confidence (1)

solana/crates/kolme-solana-bridge/src/tests.rs:736

  • Instead of a generic is_err() assertion, match the exact expected InstructionError variant to ensure the payload-tampering check is verifying the correct failure mode.
assert!(
    result.is_err(),
    "Expected error due to tampered payload"
);

@anakinzhed anakinzhed requested a review from Copilot May 27, 2025 03:49
Copy link
Contributor

@Copilot 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 introduces additional integration tests for the Kolme Solana Bridge to validate various edge cases like invalid payloads, duplicate executors, token transfer limits, and executor validations.

  • Introduces tests for handling invalid payloads, zero token transfer amounts, duplicate executor signatures, and more.
  • Updates import statements to include InitIxError for proper error handling in tests.
  • Adds comprehensive scenarios to verify transaction errors and expected state changes in token accounts.

@anakinzhed
Copy link
Contributor Author

@aakamenov All tests passed. Can you please take a look? Thank you

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