Skip to content

Commit

Permalink
Revert shuffeling algorithm for block txs
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Apr 11, 2024
1 parent 30fa727 commit 65fd3e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion blocks/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"math"
"math/big"
"math/rand/v2"
"math/rand"
"sort"

"github.com/seehuhn/mt19937"
Expand Down
7 changes: 2 additions & 5 deletions txs/conservative_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package txs

import (
"context"
"encoding/binary"
"fmt"
"math"
"math/rand/v2"
"math/rand"
"time"

"github.com/spacemeshos/go-spacemesh/common/types"
Expand Down Expand Up @@ -108,9 +107,7 @@ func getProposalTXs(
return result
}
// randomly select transactions from the predicted block.
var seed [32]byte
binary.LittleEndian.PutUint64(seed[:], uint64(time.Now().UnixNano()))
rng := rand.New(rand.NewChaCha8(seed))
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
return ShuffleWithNonceOrder(logger, rng, numTXs, predictedBlock, byAddrAndNonce)
}

Expand Down
2 changes: 1 addition & 1 deletion txs/utils.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package txs

import (
"math/rand/v2"
"math/rand"

"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/log"
Expand Down

0 comments on commit 65fd3e4

Please sign in to comment.