Page MenuHomePhabricator

[avalanche] Pass chainman to Processor
ClosedPublic

Authored by PiRK on Jul 4 2022, 15:59.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCcba2d5ffc3cb: [avalanche] Pass chainman to Processor
Summary

This removes usage of g_chainman and ::ActiveChainstate() in the Avalanche processor.

Test Plan

ninja all check-all

Event Timeline

Fabien added inline comments.
src/avalanche/processor.h
98

Is it safe ? Did you check that the ChainstateManager cannot be destructed before the Processor ?

deadalnix added inline comments.
src/avalanche/processor.h
98

If it does, then the problem is clearly not with this patch, but indeed, checking is necessary.

src/avalanche/processor.h
98

So I checked that the ChainStateManager is always destroyed last in init.cpp and in the test fixture. But do you guys mean to say that this member should be somehow made foolproof by using some kind of exotic pointer rather than a reference?

src/avalanche/processor.h
98

Maybe pass a NodeContext to wrap the chainstate in a pointer?

This revision is now accepted and ready to land.Jul 11 2022, 07:30
This revision was automatically updated to reflect the committed changes.