Skip to content

Fix ApplyChangeSet#3218

Merged
yzang2019 merged 3 commits intomainfrom
yzang/fix-memiavl-bug
Apr 9, 2026
Merged

Fix ApplyChangeSet#3218
yzang2019 merged 3 commits intomainfrom
yzang/fix-memiavl-bug

Conversation

@yzang2019
Copy link
Copy Markdown
Contributor

@yzang2019 yzang2019 commented Apr 9, 2026

Describe your changes and provide context

Problem

While the PR fixes an old MemIAVL bug where ApplyChangeSets overwrote already pending changes, there is another potential issue with ApplyChangeSet:

ApplyChangeSet just appends the changeset to the WAL.

If there are subsequent ApplyChangeSet calls for the same store before committing, each would append an entry to the WAL and mutate the live tree.

This PR fixes ApplyChangeSet to make it behave the same as ApplyChangeSets by avoiding appending duplicate keys

Testing performed to validate your change

Added unit test

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 9, 2026, 2:42 AM

* main:
  Add receipt / log reads to cryptosim (#3081)
  persist blocks and FullCommitQCs in data layer via WAL (CON-231) (#3126)
  Update Changelog in prep to cut v6.4.1 (#3213)
  fix(sei-tendermint): resolve staticcheck warnings (#3207)
  Add historical state offload stream hook (#3183)
  feat: wire autobahn config propagation from top-level to GigaRouter (CON-232) (#3194)
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.96%. Comparing base (8d7e329) to head (813fb1c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3218      +/-   ##
==========================================
- Coverage   59.02%   58.96%   -0.06%     
==========================================
  Files        2065     2060       -5     
  Lines      169414   168625     -789     
==========================================
- Hits        99994    99432     -562     
+ Misses      60673    60496     -177     
+ Partials     8747     8697      -50     
Flag Coverage Δ
sei-chain-pr 74.01% <100.00%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-db/state_db/sc/memiavl/db.go 66.66% <100.00%> (-0.05%) ⬇️

... and 56 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.

* main:
  fix: don't report block-level gas for failed tx decodes (CON-244) (#3205)
@yzang2019 yzang2019 enabled auto-merge April 9, 2026 14:40
@yzang2019 yzang2019 added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit 3664638 Apr 9, 2026
39 checks passed
@yzang2019 yzang2019 deleted the yzang/fix-memiavl-bug branch April 9, 2026 17:35
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.

3 participants