Skip to content

Conversation

MathieuDutSik
Copy link
Contributor

Motivation

For the purpose of testing if a contract exists in EVM, we introduce the functionality of testing if a contract
has non-trivial storage.

Proposal

The following is done:

  • The functionality is added to the BaseRuntime.
  • It uses the HasNonTrivialStorage in the execution_state_actor.rs.
  • It uses the view.total_size() of the KeyValueStoreView.
  • The functionality is provided to the Wasm smart contracts.

Test Plan

The CI.
For testing the has_non_trivial_storage, we implemented separately some end-to-end tests.
They have not been put in the PR, since you need two contracts:

  • one that gets instantiated
  • and one that does the has_non_trivial_storage.

Release Plan

This does not appear to be TestNet breaking.

Links

None.

@MathieuDutSik MathieuDutSik marked this pull request as ready for review September 10, 2025 12:25
@MathieuDutSik MathieuDutSik force-pushed the has_non_trivial_storage branch from 3300ead to 2c0b666 Compare September 17, 2025 06:01
@MathieuDutSik MathieuDutSik force-pushed the has_non_trivial_storage branch from 2c0b666 to c836461 Compare September 17, 2025 06:01
@MathieuDutSik MathieuDutSik changed the title Implement a function has_non_trivial_storage in BaseRuntime. Implement a function has_trivial_storage in BaseRuntime. Sep 18, 2025
@MathieuDutSik MathieuDutSik marked this pull request as draft September 24, 2025 11:16
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.

1 participant