recreate interceptors on bootstrap#7861
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bootstrap correctness issue where network components (resolvers, request handler, interceptors/syncers) were created against the bootstrap-time shard coordinator and never rebuilt after requestAndProcessing() reassigns e.shardCoordinator to the node's resolved destination shard. The fix introduces rebuildNetworkComponentsForShard(), which tears down the existing main/full-archive interceptor containers and resolvers container (unregistering their topics on both messengers) and recreates them with the resolved coordinator before the consensus topic is created. The deferred close in Bootstrap() is made nil-safe to avoid double-close after teardown.
Changes:
- Add
resolversContainerfield andrebuildNetworkComponentsForShard/tearDownStaleNetworkComponentshelpers; invoke the rebuild after the shard coordinator is reassigned inrequestAndProcessing(). - Make the deferred interceptor-container
Close()inBootstrap()nil-safe. - Add test-only accessors and three unit tests covering no-op, rewire, and error propagation behaviors.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| epochStart/bootstrap/process.go | Adds rebuild/teardown helpers, stores resolvers container, hooks rebuild into requestAndProcessing(), makes deferred close nil-safe. |
| epochStart/bootstrap/process_test.go | Adds tests for the new rebuild behavior (no-op, rewire, error propagation) and helpers to collect topics. |
| epochStart/bootstrap/export_test.go | Exports the new method and internal containers/request handler for tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7861 +/- ##
==========================================
- Coverage 76.62% 76.61% -0.01%
==========================================
Files 814 814
Lines 110955 111153 +198
==========================================
+ Hits 85019 85165 +146
- Misses 20142 20180 +38
- Partials 5794 5808 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…eptors-on-storage more bootstrap optimizations
|
❌ Integration Tests completed with failures or errors. 📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
unregister all processors on tear down
|
❌ Integration Tests completed with failures or errors. 📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
|
❌ Integration Tests completed with failures or errors. 📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
…e-order Fix transition on msg reverse order
|
❌ Integration Tests completed with failures or errors. 📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
epochStart/shardchain/triggerRegistry_test.go:26
- In cloneTrigger(), metaEpoch is being copied from t.epoch instead of t.metaEpoch. Since the new tests rely on cloneTrigger() for equality checks, this can mask real state mismatches and produce false positives.
rt.epoch = t.epoch
rt.metaEpoch = t.epoch
rt.currentRoundIndex = t.currentRoundIndex
|
❌ Integration Tests completed with failures or errors. 📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
|
❌ Integration Tests completed with failures or errors. 📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?