Skip to content

Conversation

jewei1997
Copy link
Contributor

@jewei1997 jewei1997 commented Oct 6, 2025

Describe your changes and provide context

If a user zeroes out a storage slot, we should actually delete the key/value from our chain state instead of just setting it to zero. This will reduce our total chain state over time.

Testing performed to validate your change

unit tests + integration tests.

Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.56%. Comparing base (f7a5def) to head (1e99d41).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2446      +/-   ##
==========================================
- Coverage   53.88%   51.56%   -2.33%     
==========================================
  Files        1003     1541     +538     
  Lines       96876   156516   +59640     
==========================================
+ Hits        52201    80702   +28501     
- Misses      40914    69721   +28807     
- Partials     3761     6093    +2332     
Flag Coverage Δ
sei-chain 27.55% <100.00%> (?)
sei-cosmos 51.63% <ø> (-0.01%) ⬇️
sei-tendermint 58.54% <ø> (-0.13%) ⬇️
sei-wasmd 51.44% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
x/evm/keeper/state.go 60.00% <100.00%> (ø)

... and 817 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

func (k *Keeper) SetState(ctx sdk.Context, addr common.Address, key common.Hash, val common.Hash) {
k.PrefixStore(ctx, types.StateKey(addr)).Set(key[:], val[:])
store := k.PrefixStore(ctx, types.StateKey(addr))
if val == (common.Hash{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about nil value?

@jewei1997 jewei1997 merged commit 5d6707f into main Oct 8, 2025
94 of 95 checks passed
@jewei1997 jewei1997 deleted the delete-future-zeroed-out-state branch October 8, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants