mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
The module already called itself github.com/luxfi/node while containing no node in Go: cmd/luxd was twenty-one lines that printed the size of a few types, and the Go column of the matrix measured a VM plugin. A repo that fetches the thing it claims to be has not replaced it, so the Go sources move in — 1515 files, the daemon and everything under it — and the build reaches outside this module for nothing. Rust and C++ sit beside it unchanged and are still measured against it by the differential. That is the point of one repo: the reference implementation and the two ports are the same checkout, so parity is a thing you can run rather than a thing you assert. Verified: builds, and the closure carries no lux-private — checked at build time rather than believed. The daemon starts twelve chains on a local network (P X C Q Z A B G K M F, plus D through its plugin) and reports healthy.
2.3 KiB
2.3 KiB
Mempool Gossiping
The PlatformVM has a mempool which tracks unconfirmed transactions that are waiting to be issued into blocks. The mempool is volatile, i.e. it does not persist unconfirmed transactions.
In conjunction with the introduction of Linear++, the mempool was opened to the network, allowing the gossiping of local transactions as well as the hosting of remote ones.
Mempool Gossiping Workflow
The PlatformVM's mempool performs the following workflow:
- An unconfirmed transaction is provided to
node A, either through mempool gossiping or direct issuance over an RPC. If this transaction isn't already in the local mempool, the transaction is issued into the mempool. - When
node Aissues a new transaction into its mempool, it will gossip the transaction ID by sending anGossipmessage. The node's engine will randomly select peers (currently defaulting to6nodes) to send theGossipmessage to. - When
node Blearns about the existence of a remote transaction ID, it will check if its mempool contains the transaction or if it has been recently dropped. If the transaction ID is not known,node Bwill generate a newrequestIDand respond with anRequestmessage with the unknown transaction's ID.node Bwill track the content of the request issued withrequestIDfor response verification. - Upon reception of an
Requestmessage,node Awill attempt to fetch the transaction requested in theRequestmessage from its mempool. Note that a transaction advertised in anGossipmessage may no longer be in the mempool, because they may have been included into a block, rejected, or dropped. If the transaction is retrieved, it is encoded into anResponsemessage. TheResponsemessage will carry the samerequestIDof the originatingRequestmessage and it will be sent back tonode B. - If
node Breceives anResponsemessage, it will decode the transaction and verifies that the ID matches the expected content from the originalRequestmessage. If the content matches, the transaction is validated and issued into the mempool. - If
nodeB's engine decides it isn't likely to receive anResponsemessage, the engine will issue anRequestFailuremessage. In such a casenode Bwill mark therequestIDas failed and the request for the unknown transaction is aborted.