Skip to content

fix(executor): release substate iterator on early exit#242

Open
ibrahim1023 wants to merge 1 commit into
0xsoniclabs:mainfrom
ibrahim1023:fix-substate-provider-release
Open

fix(executor): release substate iterator on early exit#242
ibrahim1023 wants to merge 1 commit into
0xsoniclabs:mainfrom
ibrahim1023:fix-substate-provider-release

Conversation

@ibrahim1023

Copy link
Copy Markdown

Description

substateProvider.Run now releases the substate iterator on every exit path, including upper-bound early exits and consumer errors.

Previously, the iterator was only released when iteration naturally reached exhaustion. For normal bounded runs, Run can return as soon as it sees a transaction at or beyond the requested upper block bound. In that path, and in the consumer-error path, the iterator was left unreleased even though the iterator contract requires Release() after use.

This change keeps the existing behavior of stopping at the exclusive upper bound, preserves consumer errors, and also surfaces iterator errors after release.

Fixes #241

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Adds or updates testing

Testing

go test ./executor

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.

substateProvider does not release iterator on early exit

1 participant