Skip to content

Harden block change handling and scheduling#281

Merged
BlobMaster41 merged 1 commit intomainfrom
fix/mempool-loop
Apr 10, 2026
Merged

Harden block change handling and scheduling#281
BlobMaster41 merged 1 commit intomainfrom
fix/mempool-loop

Conversation

@BlobMaster41
Copy link
Copy Markdown
Contributor

@BlobMaster41 BlobMaster41 commented Apr 10, 2026

Description

Avoid refreshing challenge solutions while the indexer is far behind by only calling onBlockChange when the block is within 10 blocks of the tip. Ensure verifyBlockHeight is always re-scheduled by moving the timeout into a finally block. Always trigger onBlockChange when the indexer progresses (remove the stale guard), but only advance OPNetConsensus height forward and swallow/set warnings on failures. Wrap transactionVerifier.onBlockChange and fee estimation in try/catch blocks to log warnings instead of failing the flow. Kept the old block-purge code commented.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Performance improvement
  • Consensus change (changes that affect state calculation or validation)
  • Refactoring (no functional changes)
  • Documentation update
  • CI/CD changes
  • Dependencies update

Checklist

Build & Tests

  • npm install completes without errors
  • npm run build completes without errors
  • npm test passes all tests

Code Quality

  • Code follows the project's coding standards
  • No new compiler warnings introduced
  • Error handling is appropriate
  • Logging is appropriate for debugging and monitoring

Documentation

  • Code comments added for complex logic
  • Public APIs are documented
  • README updated (if applicable)

Security

  • No sensitive data (keys, credentials) committed
  • No new security vulnerabilities introduced
  • RPC endpoints properly authenticated
  • Input validation in place for external data

OP_NET Node Specific

  • Changes are compatible with existing network state
  • Consensus logic changes are documented and tested
  • State transitions are deterministic
  • WASM VM execution is reproducible across nodes
  • P2P protocol changes are backward-compatible (or migration planned)
  • Database schema changes include migration path
  • Epoch finality and PoC/PoW logic unchanged (or documented if changed)

Testing

Consensus Impact

Related Issues


By submitting this PR, I confirm that my contribution is made under the terms of the project's license.

Avoid refreshing challenge solutions while the indexer is far behind by only calling onBlockChange when the block is within 10 blocks of the tip. Ensure verifyBlockHeight is always re-scheduled by moving the timeout into a finally block. Always trigger onBlockChange when the indexer progresses (remove the stale guard), but only advance OPNetConsensus height forward and swallow/set warnings on failures. Wrap transactionVerifier.onBlockChange and fee estimation in try/catch blocks to log warnings instead of failing the flow. Kept the old block-purge code commented.
@BlobMaster41 BlobMaster41 merged commit 4901d0c into main Apr 10, 2026
2 of 4 checks passed
@BlobMaster41 BlobMaster41 deleted the fix/mempool-loop branch April 10, 2026 10:08
@BlobMaster41 BlobMaster41 added the enhancement New feature or request label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant