Skip to content

Improve precompiles weight - #2013

Draft
HenriqueNogara wants to merge 2 commits into
developfrom
improve-precompiles-weight
Draft

HenriqueNogara wants to merge 2 commits into
developfrom
improve-precompiles-weight

Conversation

@HenriqueNogara

Copy link
Copy Markdown
Contributor

changelog

other

  • Fix can_transfer erc7943 weight.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The benchmark undercharges worst-case compliance checks, and the incorrect best-case weight makes the refund branch unreachable.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Improves NFT transfer-report weights and ERC-7943 canTransfer gas accounting, with synchronized version updates.

Changes:

  • Adds NFT transfer-report benchmarks and generated weights.
  • Updates NFT precompile gas calculations.
  • Bumps package and runtime versions.
File Summary
pallets/​weights/​src/​pallet_nft.rs Adds generated NFT transfer-report weights.
pallets/​runtime/​testnet/​src/​runtime.rs Updates runtime spec version.
pallets/​runtime/​mainnet/​src/​runtime.rs Updates runtime spec version.
pallets/​runtime/​develop/​src/​runtime.rs Updates runtime spec version.
pallets/​precompiles/​src/​interface/​nft/​erc7943.rs Updates gas accounting; best-case weight selection requires correction.
pallets/​nft/​src/​lib.rs Extends the NFT weight interface.
pallets/​nft/​src/​benchmarking.rs Adds transfer-report benchmarks; worst-case compliance traversal is not exercised.
Cargo.toml Updates package version.
Cargo.lock Updates locked package version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +394 to +396
// Max Statistics and Compliance rules are set
let (asset_id, sender, receiver, _) =
setup_nft_transfer::<T>(&alice, &bob, 1, None, None, false, 0, false);
Comment thread pallets/precompiles/src/interface/nft/erc7943.rs
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