Skip to content

Conversation

@jribbink
Copy link
Contributor

@jribbink jribbink commented Nov 4, 2025

Closes #899

Description

When fork mode is initialized, the emulator now automatically commits an initial empty block to provide a valid reference block ID for transactions. This eliminates the need for users to manually call ExecuteAndCommitBlock() before submitting transactions.

Previously, fork mode would initialize but leave the emulator in a state where it couldn't accept transactions until a reference block was manually committed. Tests had to work around this by explicitly committing a block.

Changes:

  • Auto-commit initial reference block in NewEmulatorServer when ForkHost is set
  • Remove manual workaround from fork integration tests
  • Add logging for the committed reference block

Fixes the issue where forked emulators were not immediately ready to accept transactions.


For contributor use:

  • Targeted PR against master branch
  • Linked to GitHub issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the GitHub PR explorer
  • Added appropriate labels

When fork mode is initialized, the emulator now automatically commits an
initial empty block to provide a valid reference block ID for transactions.
This eliminates the need for users to manually call ExecuteAndCommitBlock()
before submitting transactions.

Previously, fork mode would initialize but leave the emulator in a state
where it couldn't accept transactions until a reference block was manually
committed. Tests had to work around this by explicitly committing a block.

Changes:
- Auto-commit initial reference block in NewEmulatorServer when ForkHost is set
- Remove manual workaround from fork integration tests
- Add logging for the committed reference block

Fixes the issue where forked emulators were not immediately ready to accept
transactions.
@jribbink jribbink merged commit ab5961a into master Nov 4, 2025
3 checks passed
@jribbink jribbink deleted the jribbink/fork-ref branch November 4, 2025 17:31
@jribbink jribbink restored the jribbink/fork-ref branch November 5, 2025 07:30
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.

Automatically commit fork mode reference block

3 participants