Merge branch 'feat/sturdypost' into lotus_provider_config

This commit is contained in:
Andrew Jackson (Ajax) 2023-09-22 18:19:56 -05:00
commit afe4625d92
7 changed files with 17 additions and 10 deletions

View File

@ -3,9 +3,9 @@ package splitstore
import ( import (
"context" "context"
"crypto/rand"
"errors" "errors"
"fmt" "fmt"
"math/rand"
"sync" "sync"
"sync/atomic" "sync/atomic"
"testing" "testing"

View File

@ -362,7 +362,8 @@ func CreateBlockHeader(ctx context.Context, sm *stmgr.StateManager, pts *types.T
var blsMsgCids, secpkMsgCids []cid.Cid var blsMsgCids, secpkMsgCids []cid.Cid
var blsSigs []crypto.Signature var blsSigs []crypto.Signature
nv := sm.GetNetworkVersion(ctx, bt.Epoch) nv := sm.GetNetworkVersion(ctx, bt.Epoch)
for _, msg := range bt.Messages { for _, msgTmp := range bt.Messages {
msg := msgTmp
if msg.Signature.Type == crypto.SigTypeBLS { if msg.Signature.Type == crypto.SigTypeBLS {
blsSigs = append(blsSigs, msg.Signature) blsSigs = append(blsSigs, msg.Signature)
blsMessages = append(blsMessages, &msg.Message) blsMessages = append(blsMessages, &msg.Message)

View File

@ -5,7 +5,6 @@ import (
"math" "math"
"math/rand" "math/rand"
"testing" "testing"
"time"
) )
func TestBlockProbability(t *testing.T) { func TestBlockProbability(t *testing.T) {
@ -23,7 +22,6 @@ func TestBlockProbability(t *testing.T) {
func TestWinnerProba(t *testing.T) { func TestWinnerProba(t *testing.T) {
//stm: @OTHER_IMPLEMENTATION_BLOCK_PROB_002 //stm: @OTHER_IMPLEMENTATION_BLOCK_PROB_002
rand.Seed(time.Now().UnixNano())
const N = 1000000 const N = 1000000
winnerProba := noWinnersProb() winnerProba := noWinnersProb()
sum := 0 sum := 0

View File

@ -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") 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 sto.Delete {
if err := st.root.Delete(abi.AddrKey(addr)); err != nil { if err := st.root.Delete(abi.AddrKey(addr)); err != nil {
return cid.Undef, err return cid.Undef, err

View File

@ -2,6 +2,7 @@ package main
import ( import (
"context" "context"
crand "crypto/rand"
"encoding/json" "encoding/json"
"fmt" "fmt"
"math/rand" "math/rand"
@ -145,7 +146,7 @@ func MakeUnsignedMessageVectors() []vectors.UnsignedMessageVector {
} }
params := make([]byte, 32) params := make([]byte, 32)
rand.Read(params) crand.Read(params)
msg := &types.Message{ msg := &types.Message{
To: to, To: to,

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"strconv" "strconv"
"strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
@ -379,6 +380,9 @@ func (e *TaskEngine) bump(taskType string) {
return return
} }
for _, url := range res { for _, url := range res {
if !strings.HasPrefix(strings.ToLower(url), "http") {
url = "http://"
}
resp, err := hClient.Get(url + "/scheduler/bump/" + taskType) resp, err := hClient.Get(url + "/scheduler/bump/" + taskType)
if err != nil { if err != nil {
log.Info("Server unreachable to bump: ", err) log.Info("Server unreachable to bump: ", err)

View File

@ -147,8 +147,9 @@ func (sb *Sealer) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize,
}) })
} }
if len(piecePromises) == 1 { if len(piecePromises) > 0 && len(piecePromises) == 1 { // weird for linter
return piecePromises[0]() p := piecePromises[0]
return p()
} }
var payloadRoundedBytes abi.PaddedPieceSize var payloadRoundedBytes abi.PaddedPieceSize
@ -347,8 +348,9 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storiface.SectorRef, exis
} }
stagedFile = nil stagedFile = nil
if len(piecePromises) == 1 { if len(piecePromises) > 0 && len(piecePromises) == 1 { // weird for linter
return piecePromises[0]() p := piecePromises[0]
return p()
} }
var payloadRoundedBytes abi.PaddedPieceSize var payloadRoundedBytes abi.PaddedPieceSize