Skip to content
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

TP sends the future template + new prev-hash only to the last client id #74

Closed
1 task done
GitGab19 opened this issue Dec 14, 2024 · 9 comments
Closed
1 task done
Labels

Comments

@GitGab19
Copy link

GitGab19 commented Dec 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current behaviour

I have a TP-v0.1.12-NO-IPC running on testnet4.
A Pool and a JDC are connected to it. When a new tip arrives to the node, just the JDC (which is the client id=4) receives the updated template and the new prev-hash, but the Pool (client id=0) does receive only the new template.

Expected behaviour

Both Pool and JDC should receive the new template and the new prev-hash.

Steps to reproduce

Run a TP-v0.1.12-NO-IPC on testnet4, connect a SRI Pool and a JDC to it.

Relevant log output

2024-12-14T12:07:37Z UpdateTip: new best=0000000090e0151f083365df2a9595025c5f5daa10b619cba5e3cdd5a494989a height=57931 version=0x20000000 log2_work=71.645839 tx=1861682 date='2024-12-14T14:03:04Z' progress=1.000000 cache=2.3MiB(12543txo)
2024-12-14T12:07:41Z [sv2] Send 0x74 RequestTransactionData.Success to client id=4
2024-12-14T12:07:41Z CreateNewBlock(): block weight: 6212 txs: 3 fees: 5935 sigops 400
2024-12-14T12:07:41Z [sv2] Send 0x71 NewTemplate id=389 future=1 to client id=4
2024-12-14T12:07:41Z [sv2] Send 0x72 SetNewPrevHash to client id=4
2024-12-14T12:07:41Z CreateNewBlock(): block weight: 6212 txs: 3 fees: 5935 sigops 400
2024-12-14T12:07:41Z [sv2] Send 0x71 NewTemplate id=390 future=0 to client id=0
2024-12-14T12:07:41Z [sv2] Received 0x73 RequestTransactionData from client id=4
2024-12-14T12:07:51Z [sv2] Send 0x74 RequestTransactionData.Success to client id=4
2024-12-14T12:08:02Z CreateNewBlock(): block weight: 43690 txs: 20 fees: 34515 sigops 401
2024-12-14T12:08:02Z [sv2] Send 0x71 NewTemplate id=391 future=0 to client id=4
2024-12-14T12:08:02Z CreateNewBlock(): block weight: 43690 txs: 20 fees: 34515 sigops 401
2024-12-14T12:08:02Z [sv2] Send 0x71 NewTemplate id=392 future=0 to client id=0
2024-12-14T12:08:02Z [sv2] Received 0x73 RequestTransactionData from client id=4
2024-12-14T12:08:12Z [sv2] Send 0x74 RequestTransactionData.Success to client id=4
2024-12-14T12:08:23Z CreateNewBlock(): block weight: 57934 txs: 29 fees: 45072 sigops 401
2024-12-14T12:08:23Z [sv2] Send 0x71 NewTemplate id=393 future=0 to client id=4
2024-12-14T12:08:23Z CreateNewBlock(): block weight: 57934 txs: 29 fees: 45072 sigops 401
2024-12-14T12:08:23Z [sv2] Send 0x71 NewTemplate id=394 future=0 to client id=0
2024-12-14T12:08:23Z [sv2] Received 0x73 RequestTransactionData from client id=4
2024-12-14T12:08:33Z [sv2] Send 0x74 RequestTransactionData.Success to client id=4
2024-12-14T12:08:38Z Saw new header hash=00000000000000158139758b953e601aca9d63b3ffc28dab5a1933e2fc67703c height=57932
2024-12-14T12:08:38Z UpdateTip: new best=00000000000000158139758b953e601aca9d63b3ffc28dab5a1933e2fc67703c height=57932 version=0x219ae000 log2_work=71.646077 tx=1861683 date='2024-12-14T13:25:40Z' progress=1.000000 cache=2.3MiB(12572txo)
2024-12-14T12:08:38Z CreateNewBlock(): block weight: 74353 txs: 40 fees: 57255 sigops 403
2024-12-14T12:08:38Z [sv2] Send 0x71 NewTemplate id=395 future=1 to client id=4
2024-12-14T12:08:38Z [sv2] Send 0x72 SetNewPrevHash to client id=4
2024-12-14T12:08:38Z CreateNewBlock(): block weight: 74353 txs: 40 fees: 57255 sigops 403
2024-12-14T12:08:38Z [sv2] Send 0x71 NewTemplate id=396 future=0 to client id=0
2024-12-14T12:08:38Z [sv2] Received 0x73 RequestTransactionData from client id=4
2024-12-14T12:08:41Z Saw new header hash=00000000030a517c4b183e05bf27b34706a7d48aa2226b62ffb8122c5b916177 height=57933
2024-12-14T12:08:41Z Saw new cmpctblock header hash=00000000030a517c4b183e05bf27b34706a7d48aa2226b62ffb8122c5b916177 peer=10
2024-12-14T12:08:41Z UpdateTip: new best=00000000030a517c4b183e05bf27b34706a7d48aa2226b62ffb8122c5b916177 height=57933 version=0x20000000 log2_work=71.646077 tx=1861724 date='2024-12-14T13:45:41Z' progress=1.000000 cache=2.3MiB(12576txo)
2024-12-14T12:08:41Z Saw new header hash=00000000fe0ba6a05e3c19d92024cd8693612fe943ad5d0c8bd4c4322441df67 height=57934
2024-12-14T12:08:41Z Saw new cmpctblock header hash=00000000fe0ba6a05e3c19d92024cd8693612fe943ad5d0c8bd4c4322441df67 peer=8
2024-12-14T12:08:41Z UpdateTip: new best=00000000fe0ba6a05e3c19d92024cd8693612fe943ad5d0c8bd4c4322441df67 height=57934 version=0x20000000 log2_work=71.646077 tx=1861725 date='2024-12-14T14:05:42Z' progress=1.000000 cache=2.3MiB(12577txo)
2024-12-14T12:08:48Z [sv2] Send 0x74 RequestTransactionData.Success to client id=4
2024-12-14T12:08:48Z CreateNewBlock(): block weight: 5726 txs: 3 fees: 2792 sigops 404
2024-12-14T12:08:48Z [sv2] Send 0x71 NewTemplate id=397 future=1 to client id=4
2024-12-14T12:08:48Z [sv2] Send 0x72 SetNewPrevHash to client id=4
2024-12-14T12:08:48Z CreateNewBlock(): block weight: 5726 txs: 3 fees: 2792 sigops 404
2024-12-14T12:08:48Z [sv2] Send 0x71 NewTemplate id=398 future=0 to client id=0
2024-12-14T12:08:48Z [sv2] Received 0x73 RequestTransactionData from client id=4
2024-12-14T12:08:58Z [sv2] Send 0x74 RequestTransactionData.Success to client id=4

How did you obtain Bitcoin Core

Pre-built binaries

What version of Bitcoin Core are you using?

v0.1.12-NO-IPC

Operating system and version

MacOS v13.0.1

Machine specifications

No response

@GitGab19 GitGab19 added the bug label Dec 14, 2024
@Sjors
Copy link
Owner

Sjors commented Dec 14, 2024

It looks like it sets future for client 4, but not for client 0, which would explain why it didn't send the prevhash on the second. I'll look into that.

2024-12-14T12:07:37Z UpdateTip: new best=0000000090e0151f083365df2a9595025c5f5daa10b619cba5e3cdd5a494989a height=57931 version=0x20000000 log2_work=71.645839 tx=1861682 date='2024-12-14T14:03:04Z' progress=1.000000 cache=2.3MiB(12543txo)
...
2024-12-14T12:07:41Z [sv2] Send 0x71 NewTemplate id=389 future=1 to client id=4
2024-12-14T12:07:41Z [sv2] Send 0x72 SetNewPrevHash to client id=4
...
2024-12-14T12:07:41Z [sv2] Send 0x71 NewTemplate id=390 future=0 to client id=0

Do you know if the tip at height 57931 came via SubmitSolution or via the p2p network?

@Sjors
Copy link
Owner

Sjors commented Dec 14, 2024

@GitGab19 can you test if https://github.com/Sjors/bitcoin/tree/2024/12/future-template fixes it?

If so I'll push that commit onto the sv2 and sv2-ipc branches, and bake a new release early next week.

@GitGab19
Copy link
Author

Do you know if the tip at height 57931 came via SubmitSolution or via the p2p network?

p2p network

@GitGab19
Copy link
Author

@GitGab19 can you test if https://github.com/Sjors/bitcoin/tree/2024/12/future-template fixes it?

If so I'll push that commit onto the sv2 and sv2-ipc branches, and bake a new release early next week.

I can test it tomorrow, I'll let you know

@Sjors
Copy link
Owner

Sjors commented Dec 15, 2024

If you're running without IPC, then just cherry-pick 52905b2 on top of the release tag.

@Sjors
Copy link
Owner

Sjors commented Dec 16, 2024

Tested by running pool, JDS and JDC connected to the same node. It seems to behave now, but would be good to confirm.

@Sjors
Copy link
Owner

Sjors commented Dec 16, 2024

I pushed the fix onto both the sv2 and sv2-ipc branches. So you can test either.

@GitGab19
Copy link
Author

I tested it on testnet4 and it worked well 👍

@Sjors
Copy link
Owner

Sjors commented Dec 16, 2024

Thanks for testing. Fix is squashed into c06be1c which is used by both sv2 and sv2-ipc.

@Sjors Sjors closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants