1

As far as I know, Geth stores pending items in their Txpool.

Does "broadcast" means polling again and again to each peer clients until get processed?

What's exact name of the function that broadcasts transaction on source code?

And, with picture below, the number 5, what places do miners seeks to choose which transactions to execute?

enter image description here

1

Depends on how you submit the transaction. If you're using a GUI wallet, the wallet itself may use LES (Light Ethereum Subprotocol) to submit your transaction to one or many ethereum nodes. Each node then may forward them further. In case of Geth it's hardcoded to broadcast each via LES submitted transaction to 3 other peers exactly one time. So if your wallet transmits a transaction to 10 nodes then each node will broadcast your transaction further resulting in 10+10x3=40 nodes having seen your transaction.

Miners are nodes which also create blocks. So after above broadcasting your transaction must have made to a node that is also mining and that selects your transaction into a candidate block.

LES: https://wiki.parity.io/Light-Ethereum-Subprotocol-(LES)

Geth Relay: https://github.com/ethereum/go-ethereum/blob/master/les/txrelay.go

The send() and Send() function are the relevant parts.

func (self *LesTxRelay) Send(txs types.Transactions) { self.lock.Lock() defer self.lock.Unlock()

self.send(txs, 3)

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.