Skip to content

Conversation

@jimmygchen
Copy link
Member

@jimmygchen jimmygchen commented Nov 10, 2025

Issue Addressed

A discord user reported a panic during startup and it wasn't recurring. This seems like a rare race condition that wasn't possible until custody backfill was introduced, and this queried custody context before it was initialised:

if !self.should_start_custody_backfill_sync() {

custody context initialised here:

init_custody_context(beacon_chain, &network_globals)?;

I've been thinking about fixing the race condition but thought this may be a simpler fix, however this end up being quite tedious and requiring a lot of changes.

I'm going to look into the alternatives of fixing the race conditions properly and compare the solutions.

NOTE: This currently targets unstable, but I can rebase this into the release branch if we want to include this in v8.0.1.

@jimmygchen jimmygchen requested a review from jxs as a code owner November 10, 2025 06:48
@jimmygchen jimmygchen added the bug Something isn't working label Nov 10, 2025
@jimmygchen
Copy link
Member Author

Closing in favour of #8391

@jimmygchen jimmygchen closed this Nov 12, 2025
mergify bot pushed a commit that referenced this pull request Nov 17, 2025
…8391)

Take 2 of #8390.

Fixes the race condition properly instead of propagating the error. I think this is a better alternative, and doesn't seem to look that bad.


  * Lift node id loading or generation from `NetworkService ` startup to the `ClientBuilder`, so that it can be used to compute custody columns for the beacon chain without waiting for Network bootstrap.

I've considered and implemented a few alternatives:
1. passing `node_id` to beacon chain builder and compute columns when creating `CustodyContext`. This approach isn't good for separation of concerns and isn't great for testability
2. passing `ordered_custody_groups` to beacon chain. `CustodyContext` only uses this to compute ordered custody columns, so we might as well lift this logic out, so we don't have to do error handling in `CustodyContext` construction. Less tests to update;.


Co-Authored-By: Jimmy Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant