-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Remove p2pEnabled from Chain interface #16503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Also when ACK 18d6a81505123e703be87aa31eeb7fb48b5d50bd. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
|
~0 on this Needs review by @theuni, he probably knows the reasoning behind this. I think the intent was that it's possible to run the node without P2P enabled at all, even though it's currently not an option. (or maybe the idea was to make various parts more loosely coupled to have more flexibility in the initialization sequence)
Yes, please do this. Otherwise, in the case of a bug in the initialization sequence that skips the P2P initialization it runs into a null pointer exception. |
@laanwj I don't think just checking |
|
I would argue that removing global use in Yes of course @theuni should know the reason and if checks are still relevant. Note : #15713 is removing relayTransaction on the p2p check, wallet should just submit txn to mempool |
|
ACK 18d6a81505123e703be87aa31eeb7fb48b5d50bd
Seems reasonable. I'd add a comment saying something like:
|
|
@ariard Are you still working on this? |
|
Yes, still waiting Concept ACK by @theuni to go further |
|
No need to allow this to be blocked by one person. I suggest you keep this rebased so it's ready to merge. |
18d6a81 to
6e08957
Compare
|
Rebased at 6e08957. |
|
unsigned ACK 6e089572a79de38a08692b23b8a139171082139b (only looked at the diff on GitHub) I think it makes sense to remove obviously dead code. And if it wasn't dead code, it would be racy and result in either an assert failure or a segmentation fault. |
|
Do you mind adding a comment to the "BroadcastTransaction can be called by the RPC server or wallet. g_connman is assigned before chain clients and the RPC server are started, and reset after chain clients adn the RPC are stopped are stopped. g_connman should never be null here." |
RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped.
6e08957 to
b7b9f6e
Compare
|
Comment added at b7b9f6e |
|
ACK b7b9f6e |
1 similar comment
|
ACK b7b9f6e |
b7b9f6e Remove p2pEnabled from Chain interface (Antoine Riard) Pull request description: RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped. @mzumsande comment in bitcoin#15713 let me thought that `p2pEnabled` was maybe useless, `g_connman` is always initialized before RPC server is getting out of warmup. These checks against P2P state were introduced in bitcoin@5b446dd. ACKs for top commit: promag: ACK b7b9f6e jnewbery: ACK b7b9f6e Tree-SHA512: 4de2b9fc496bf8347ff5cc645848a5a44c8ca7596cd134f17f3088f5f8262d1d88b8e2a052df93e309ec9a81956a808df17a9eb9f10d4f4d693c95d607fe3561
|
Sorry for the delay. Post-merge concept ACK. Chain was the wrong place for this anyway. |
Summary: Remove p2pEnabled from Chain interface (Antoine Riard) Pull request description: RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped. @mzumsande comment in #15713 let me thought that `p2pEnabled` was maybe useless, `g_connman` is always initialized before RPC server is getting out of warmup. These checks against P2P state were introduced in bitcoin/bitcoin@5b446dd. --- Backport of Core [[bitcoin/bitcoin#16503 | PR16503]] Test Plan: ninja check check-functional Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7369
RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped.
@mzumsande comment in #15713 let me thought that
p2pEnabledwas maybe useless,g_connmanis always initialized before RPC server is getting out of warmup. These checks against P2P state were introduced in 5b446dd.