Use real blockProbabilities function
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
080614098d
commit
d3c8f295c2
@ -3,7 +3,6 @@ package messagepool
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"math/big"
|
"math/big"
|
||||||
"math/rand"
|
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -281,24 +280,6 @@ tailLoop:
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mp *MessagePool) blockProbabilities(tq float64) []float64 {
|
|
||||||
// TODO FIXME fit in the actual probability distribution
|
|
||||||
// this just makes a dummy random distribution for testing purposes
|
|
||||||
bps := make([]float64, MaxBlocks)
|
|
||||||
norm := 0.0
|
|
||||||
for i := 0; i < MaxBlocks; i++ {
|
|
||||||
p := rand.Float64()
|
|
||||||
bps[i] = p
|
|
||||||
norm += p
|
|
||||||
}
|
|
||||||
// normalize to make it a distribution
|
|
||||||
for i := 0; i < MaxBlocks; i++ {
|
|
||||||
bps[i] /= norm
|
|
||||||
}
|
|
||||||
|
|
||||||
return bps
|
|
||||||
}
|
|
||||||
|
|
||||||
func (mp *MessagePool) selectMessagesGreedy(curTs, ts *types.TipSet) ([]*types.SignedMessage, error) {
|
func (mp *MessagePool) selectMessagesGreedy(curTs, ts *types.TipSet) ([]*types.SignedMessage, error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user