Skip to content

Rework dBFT transactions routing #98

@AnnaShaleva

Description

@AnnaShaleva

Rationale

After #84 dBFT is able to request transactions by hashes from the node's peers. However, dBFT's OnTransaction callback is being called for every transaction that enters mempool:

case txs := <-c.txEvents:
for _, tx := range txs.Txs {
c.dbft.OnTransaction(&Transaction{Tx: tx})
}

This behaviour is correct but not optimal. Ref. #84 (comment).

Implementation

Within the scope of this issue we need to save the list of hashes requested by dBFT and then call OnTransaction callback only for requested transactions. Ref. NeoGo's (s *Server) RequestTx implementation related to txCbList variable: https://github.com/nspcc-dev/neo-go/blob/ed736281002132235d15adf2c64b9f6ad2431197/pkg/network/server.go#L1468.

Metadata

Metadata

Assignees

Labels

dBFTEverything related to dBFT module integrationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions