moonbeam icon indicating copy to clipboard operation
moonbeam copied to clipboard

Test :test_tube:: add gas/weight tests for Foreign Assets calls

Open pLabarta opened this issue 11 months ago • 3 comments

What does it do?

This PR adds tests for checking weight and gas costs associated with creating and interacting with Foreign Assets. On the Substrate side it checks the weights for creation, freeze, unfreeze and changing the XCM location. On the EVM side it just checks gas costs associated with a simple transfer.

What important points should reviewers know?

The key aspect of these tests is checking that the costs are not over the block limits and seem reasonable. This comes after detecting an issue in the benchmarks for these calls that caused much higher weights than the actual used storage and compute time.

Is there something left for follow-up PRs?

This PR does not consider XCM tests for interacting with the new implementation of Foreign Assets. These should be added to #3104.

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

pLabarta avatar Feb 04 '25 15:02 pLabarta

WASM runtime size check:

Compared to target branch

Moonbase runtime: 2420 KB (no changes) 🚨

Moonbeam runtime: 2404 KB (no changes) 🚨

Moonriver runtime: 2392 KB (no changes) ✅

Compared to latest release (runtime-3401)

Moonbase runtime: 2420 KB (+388 KB compared to latest release) 🚨

Moonbeam runtime: 2404 KB (+392 KB compared to latest release) 🚨

Moonriver runtime: 2392 KB (+380 KB compared to latest release) ⚠️

github-actions[bot] avatar Feb 04 '25 15:02 github-actions[bot]

Coverage Report

@@                        Coverage Diff                         @@
##           master   pablo/test/foreign-assets-tests     +/-   ##
==================================================================
  Coverage   74.79%                            74.79%   0.00%     
  Files         400                               400             
  Lines      101212                            101212             
==================================================================
  Hits        75696                             75696             
  Misses      25516                             25516             
Files Changed Coverage

Coverage generated Tue May 13 14:00:39 UTC 2025

github-actions[bot] avatar Feb 04 '25 16:02 github-actions[bot]

@pLabarta do we still want this?

RomarQ avatar Jul 18 '25 13:07 RomarQ