Skip to content

Conversation

@techraed
Copy link
Member

@techraed techraed commented Sep 2, 2025

  1. Adds eth-bridge and bls12_381 builtins with corresponding tests. The introduced codebase almost identically copies builtins from pallet, but doesn't adapt it fully to the gtest, leaving some "obtain payload length" functionality for future gas charge feature.
  2. Refactors a little bit WasmProgram trait for mock programs

The gas charging for builtins is missing and is intended to be introduced in following PRs

@techraed techraed self-assigned this Sep 2, 2025
@techraed techraed added the A0-pleasereview PR is ready to be reviewed by the team label Sep 2, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Sep 2, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  gtest/src/manager/reservations.rs  96% smaller
  gtest/src/state/mod.rs  89% smaller
  gtest/src/manager/journal.rs  83% smaller
  pallets/gear-builtin/src/tests/bad_builtin_ids.rs  78% smaller
  gtest/src/program.rs  73% smaller
  gtest/src/system.rs  69% smaller
  pallets/gear-builtin/src/tests/bls381.rs  65% smaller
  pallets/gear-builtin/src/benchmarking.rs  55% smaller
  pallets/gear-eth-bridge/src/internal.rs  41% smaller
  pallets/gear-builtin/src/lib.rs  38% smaller
  pallets/gear-builtin/src/mock.rs  36% smaller
  gtest/src/state/programs.rs  17% smaller
  pallets/gear-builtin/src/bls12_381.rs  16% smaller
  gtest/src/manager/block_exec.rs  12% smaller
  runtime-interface/src/lib.rs  10% smaller
  gbuiltins/bls381/src/lib.rs  4% smaller
  gbuiltins/eth-bridge/src/lib.rs  4% smaller
  gtest/src/manager/memory.rs  1% smaller
  pallets/gear-eth-bridge/src/builtin.rs  1% smaller
  Cargo.lock Unsupported file format
  Cargo.toml Unsupported file format
  ethexe/common/Cargo.toml Unsupported file format
  gbuiltins/bls381/Cargo.toml Unsupported file format
  gbuiltins/eth-bridge/Cargo.toml Unsupported file format
  gtest/Cargo.toml Unsupported file format
  gtest/src/builtins/bls12_381.rs  0% smaller
  gtest/src/builtins/eth_bridge.rs  0% smaller
  gtest/src/builtins/mod.rs  0% smaller
  gtest/src/lib.rs  0% smaller
  gtest/src/manager.rs  0% smaller
  gtest/src/state/bridge.rs  0% smaller
  gtest/src/state/mailbox/actor.rs Unsupported file format
  pallets/gear-builtin/Cargo.toml Unsupported file format
  pallets/gear-eth-bridge/Cargo.toml Unsupported file format
  pallets/gear-eth-bridge/src/tests.rs  0% smaller
  runtime-interface/Cargo.toml Unsupported file format
  utils/builtins-common/Cargo.toml Unsupported file format
  utils/builtins-common/src/bls12_381.rs  0% smaller
  utils/builtins-common/src/bls12_381/high_level.rs  0% smaller
  utils/builtins-common/src/bls12_381/low_level.rs  0% smaller
  utils/builtins-common/src/eth_bridge.rs  0% smaller
  utils/builtins-common/src/lib.rs  0% smaller
  utils/crates-io/src/lib.rs  0% smaller

Copy link
Member

@StackOverflowExcept1on StackOverflowExcept1on left a comment

Choose a reason for hiding this comment

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

LGTM, but we should think about not being too dependent on blockchain framework and moving it into separate crates

@techraed
Copy link
Member Author

techraed commented Oct 2, 2025

@breathx @StackOverflowExcept1on both your suggestions are applied

@techraed techraed merged commit 408d42a into master Nov 1, 2025
28 checks passed
@techraed techraed deleted the st-gtest-builtins branch November 1, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-pleasereview PR is ready to be reviewed by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants