Announcement for miner developers:
The following PR (
https://github.com/kaspanet/kaspad/pull/1988) added a new event type to the RPC API, dedicated for miners.
The event is named NewBlockTemplate. (
https://github.com/kaspanet/kaspad/blob/dev/infrastructure/network/netadapter/server/grpcserver/protowire/rpc.md#notifynewblocktemplaterequestmessage)
Miner software should replace the current BlockAdded event with this event.
This event is called only when the real conditions for a block template update were met (for instance a block can be added to the DAG but is not always
added as parent of virtual due to various mining rules). Additionally, we avoid calling this event during IBD when thousands of blocks are added to the DAG
every second, and in the future we might trigger this event also as a result of mempool changes.
I'm implementing several more optimizations for the miner-kaspad communication cycle, including template caching, and modifying
"out of sync"/isSynced definition such that miners will mine under all possible circumstances.
Hence our recommendations for miners are the following:
- Register to the new event type (perhaps verify that kaspad version >= 0.11.15 or simply try and if you error fallback to prev event)
-- As a reference, the registration was updated in the native go miner already
https://github.com/kaspanet/kaspad/blob/dev/cmd/kaspaminer/client.go#L33- If the template you get is marked isSynced=false, do not mine, we will indicate this only when the node is really behind (unlike now).
- If you do decide to mine even if isSynced=false, use the latest template you just received and not anything older
@someone235 @hauntedcook @demisrael @iedoc @elichai2 @Community Developer
GitHub
Optimize the miner-kaspad flow and latency by michaelsutton · Pull ...
This PR includes initial changes to improve the miner-to-kaspad communication cycle, including the following:
A dedicated "new block template" event for notifying miners only when necess...
Optimize the miner-kaspad flow and latency by michaelsutton · Pull ...
GitHub
kaspad/client.go at dev · kaspanet/kaspad
Kaspad is the reference full node Kaspa implementation written in Go (golang). - kaspad/client.go at dev · kaspanet/kaspad
kaspad/client.go at dev · kaspanet/kaspad