Merge branch 'feat/sturdypost' into lotus_provider_config
This commit is contained in:
commit
afe4625d92
@ -3,9 +3,9 @@ package splitstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
@ -362,7 +362,8 @@ func CreateBlockHeader(ctx context.Context, sm *stmgr.StateManager, pts *types.T
|
||||
var blsMsgCids, secpkMsgCids []cid.Cid
|
||||
var blsSigs []crypto.Signature
|
||||
nv := sm.GetNetworkVersion(ctx, bt.Epoch)
|
||||
for _, msg := range bt.Messages {
|
||||
for _, msgTmp := range bt.Messages {
|
||||
msg := msgTmp
|
||||
if msg.Signature.Type == crypto.SigTypeBLS {
|
||||
blsSigs = append(blsSigs, msg.Signature)
|
||||
blsMessages = append(blsMessages, &msg.Message)
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"math"
|
||||
"math/rand"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestBlockProbability(t *testing.T) {
|
||||
@ -23,7 +22,6 @@ func TestBlockProbability(t *testing.T) {
|
||||
|
||||
func TestWinnerProba(t *testing.T) {
|
||||
//stm: @OTHER_IMPLEMENTATION_BLOCK_PROB_002
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
const N = 1000000
|
||||
winnerProba := noWinnersProb()
|
||||
sum := 0
|
||||
|
@ -438,7 +438,8 @@ func (st *StateTree) Flush(ctx context.Context) (cid.Cid, error) {
|
||||
return cid.Undef, xerrors.Errorf("tried to flush state tree with snapshots on the stack")
|
||||
}
|
||||
|
||||
for addr, sto := range st.snaps.layers[0].actors {
|
||||
for addr, stoTmp := range st.snaps.layers[0].actors {
|
||||
sto := stoTmp
|
||||
if sto.Delete {
|
||||
if err := st.root.Delete(abi.AddrKey(addr)); err != nil {
|
||||
return cid.Undef, err
|
||||
|
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
crand "crypto/rand"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
@ -145,7 +146,7 @@ func MakeUnsignedMessageVectors() []vectors.UnsignedMessageVector {
|
||||
}
|
||||
|
||||
params := make([]byte, 32)
|
||||
rand.Read(params)
|
||||
crand.Read(params)
|
||||
|
||||
msg := &types.Message{
|
||||
To: to,
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@ -379,6 +380,9 @@ func (e *TaskEngine) bump(taskType string) {
|
||||
return
|
||||
}
|
||||
for _, url := range res {
|
||||
if !strings.HasPrefix(strings.ToLower(url), "http") {
|
||||
url = "http://"
|
||||
}
|
||||
resp, err := hClient.Get(url + "/scheduler/bump/" + taskType)
|
||||
if err != nil {
|
||||
log.Info("Server unreachable to bump: ", err)
|
||||
|
@ -147,8 +147,9 @@ func (sb *Sealer) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize,
|
||||
})
|
||||
}
|
||||
|
||||
if len(piecePromises) == 1 {
|
||||
return piecePromises[0]()
|
||||
if len(piecePromises) > 0 && len(piecePromises) == 1 { // weird for linter
|
||||
p := piecePromises[0]
|
||||
return p()
|
||||
}
|
||||
|
||||
var payloadRoundedBytes abi.PaddedPieceSize
|
||||
@ -347,8 +348,9 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storiface.SectorRef, exis
|
||||
}
|
||||
stagedFile = nil
|
||||
|
||||
if len(piecePromises) == 1 {
|
||||
return piecePromises[0]()
|
||||
if len(piecePromises) > 0 && len(piecePromises) == 1 { // weird for linter
|
||||
p := piecePromises[0]
|
||||
return p()
|
||||
}
|
||||
|
||||
var payloadRoundedBytes abi.PaddedPieceSize
|
||||
|
Loading…
Reference in New Issue
Block a user