Skip to content

Commit

Permalink
miner: multi signers (#5135)
Browse files Browse the repository at this point in the history
closes: #5087

data is separated into shared data (beacon and active set) and signer specific data. both beacon and activeset are used from shared data, until smeshers generated a reference ballot. once any smesher generated a ballot it will be using data recorded in the reference ballot. 

build method now loops over all signers (copied at the start of the layer). there are parts that have to be run once for all signers and parts that makes sense to run in parallel.

serial parts:
- loading share data (beacon and active set)
- deciding on mesh hash
- tally votes & encode votes tortoise calls

parallel parts:
- loading data (it can be also run serially, but it was convenient to run it in parallel)
- computing eligibilities (this is done once per node startup)
- selecting txs
- publishing proposal. this is the most important to avoid blocking serially in Publish while it runs validation

worker pool (errgroup) is limited by number of cores as there is no network requests during parallel work.
  • Loading branch information
dshulyak committed Oct 16, 2023
1 parent 156d084 commit b545097
Show file tree
Hide file tree
Showing 5 changed files with 697 additions and 263 deletions.
4 changes: 2 additions & 2 deletions miner/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func (lt *latencyTracker) total() time.Duration {
func (lt *latencyTracker) MarshalLogObject(encoder log.ObjectEncoder) error {
encoder.AddDuration("data", lt.data.Sub(lt.start))
encoder.AddDuration("tortoise", lt.tortoise.Sub(lt.data))
encoder.AddDuration("txs", lt.txs.Sub(lt.tortoise))
encoder.AddDuration("hash", lt.hash.Sub(lt.txs))
encoder.AddDuration("hash", lt.hash.Sub(lt.tortoise))
encoder.AddDuration("txs", lt.txs.Sub(lt.hash))
encoder.AddDuration("publish", lt.publish.Sub(lt.hash))
total := lt.total()
encoder.AddDuration("total", total)
Expand Down
Loading

0 comments on commit b545097

Please sign in to comment.