Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5631405
SF-v1.6.0 initial test
raduchis Sep 5, 2023
5ac599c
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Sep 6, 2023
91774dc
set singlesigner to disabled
raduchis Sep 7, 2023
075e960
do not check peerSignature
raduchis Sep 8, 2023
797b712
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Sep 8, 2023
19d6b88
added epochsFastForward
raduchis Sep 11, 2023
e6fb9d2
Merge remote-tracking branch 'origin/rc/v1.6.0' into SF-v1.6.0
raduchis Sep 18, 2023
8d41d1c
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Nov 10, 2023
4cd3a71
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Nov 21, 2023
f1ac25d
Merge branch 'master' into SF-v1.6.0
raduchis Jan 15, 2024
475ee29
Merge remote-tracking branch 'origin/new-vm-common' into SF-v1.6.0
raduchis Jan 16, 2024
d8d459e
MaxTxNonceDeltaAllowed = 100000
raduchis Jan 17, 2024
67ad2eb
Merge remote-tracking branch 'origin/migrate-data-trie-fix' into SF-v…
raduchis Jan 25, 2024
72201bf
Merge remote-tracking branch 'origin/rc/v1.7.0' into SF-v1.7.0
raduchis Jan 30, 2024
140d553
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis Apr 12, 2024
79621d8
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis Apr 22, 2024
1f8a378
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis Apr 23, 2024
8cc7cf9
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis May 9, 2024
3dfbc41
Merge branch 'master' into SF-v1.7.0
raduchis May 21, 2024
1d40241
Merge branch 'master' into SF-v1.7.0
raduchis May 29, 2024
b2a3668
Merge branch 'master' into SF-1.7.0
raduchis Jul 2, 2024
24ceef3
Merge branch 'master' into SF-1.7.0
raduchis Aug 20, 2024
d205e62
Merge branch 'master' into SF-1.7.0
raduchis Nov 25, 2024
0585cba
Merge branch 'master' into SF-1.8.6
ssd04 Jan 10, 2025
8a94f2d
Merge branch 'master' into SF-1.8.11
ssd04 Feb 28, 2025
af69ba1
revert go mod
sasurobert May 14, 2025
d9f7ad4
revert go mod
sasurobert May 14, 2025
023df75
revert go mod
sasurobert May 14, 2025
ba34423
revert go mod
sasurobert May 14, 2025
16b5f83
Merge tag 'v1.8.13' into SF-1.8.13
raduchis May 15, 2025
7719e88
Merge branch 'SF-1.8.13' into SF-1.9.6
raduchis May 19, 2025
534fa5e
Merge branch 'refs/heads/rc/barnard' into SF-1.10.0
raduchis Jun 26, 2025
11e9ec4
Merge branch 'rc/barnard' into SF-1.10.0
raduchis Jul 9, 2025
6fc8110
Merge branch 'rc/barnard' into SF-1.10.0
raduchis Jul 10, 2025
2e3a611
Merge branch 'rc/barnard' into SF-1.10.0
raduchis Jul 16, 2025
2fc3cec
Merge remote-tracking branch 'origin/master' into SF-1.10.0
raduchis Aug 19, 2025
d3e2d57
Merge branch 'master' into SF-1.10.0
raduchis Sep 9, 2025
e39b81c
Merge branch 'master' into SF-1.10.0
raduchis Nov 26, 2025
d141f02
removed check for signatureShare size
raduchis Nov 14, 2025
8e0252d
updated to accept also some other chainID
raduchis Nov 25, 2025
b99ebe5
rename DB folder
raduchis Nov 25, 2025
a14592b
update private key handling for managed peers
raduchis Sep 23, 2025
06fd222
added allValidatorsKeysSF.pem
raduchis Nov 27, 2025
39e94fe
hopefully fixed observers with txPool activated
raduchis Feb 7, 2026
99029c4
reverted fix
raduchis Feb 7, 2026
4c818bc
removed rewards txs computation
raduchis Feb 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/node/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ var (
allValidatorKeysPemFile = cli.StringFlag{
Name: "all-validator-keys-pem-file",
Usage: "The `filepath` for the PEM file which contains all the secret keys managed by the current node.",
Value: "./config/allValidatorsKeys.pem",
Value: "./config/allValidatorsKeysSF.pem",
}

// logLevel defines the logger level
Expand Down
31 changes: 31 additions & 0 deletions cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"path/filepath"
"runtime"
"time"

Expand Down Expand Up @@ -82,13 +83,43 @@ func main() {
return startNodeRunner(c, log, baseVersion, app.Version)
}

// TODO: remove this after the first release
renameDB()

err := app.Run(os.Args)
if err != nil {
log.Error(err.Error())
os.Exit(1)
}
}

func renameDB() {
// Define source and destination paths
sourcePath := filepath.Join("db", "1")
destPath := filepath.Join("db", "B")

// Check if source directory exists
if _, err := os.Stat(sourcePath); os.IsNotExist(err) {
fmt.Printf("Error: Source directory '%s' does not exist\n", sourcePath)
//os.Exit(1)
}

// Check if destination already exists
if _, err := os.Stat(destPath); err == nil {
fmt.Printf("Error: Destination directory '%s' already exists\n", destPath)
//os.Exit(1)
}

// Rename the directory
err := os.Rename(sourcePath, destPath)
if err != nil {
fmt.Printf("Error renaming directory: %v\n", err)
//os.Exit(1)
}

fmt.Printf("Successfully renamed '%s' to '%s'\n", sourcePath, destPath)
}

func startNodeRunner(c *cli.Context, log logger.Logger, baseVersion string, version string) error {
flagsConfig := getFlagsConfig(c, log)

Expand Down
2 changes: 1 addition & 1 deletion common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const DisabledShardIDAsObserver = uint32(0xFFFFFFFF) - 7

// MaxTxNonceDeltaAllowed specifies the maximum difference between an account's nonce and a received transaction's nonce
// in order to mark the transaction as valid.
const MaxTxNonceDeltaAllowed = 100
const MaxTxNonceDeltaAllowed = 100000

// MaxBulkTransactionSize specifies the maximum size of one bulk with txs which can be send over the network
// TODO convert this const into a var and read it from config when this code moves to another binary
Expand Down
30 changes: 30 additions & 0 deletions consensus/spos/bls/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@
MtInvalidSigners
)

// waitingAllSigsMaxTimeThreshold specifies the max allocated time for waiting all signatures from the total time of the subround signature
const waitingAllSigsMaxTimeThreshold = 0.5

Check failure on line 37 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `waitingAllSigsMaxTimeThreshold` is unused (unused)

// processingThresholdPercent specifies the max allocated time for processing the block as a percentage of the total time of the round
const processingThresholdPercent = 85

Check failure on line 40 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `processingThresholdPercent` is unused (unused)

// srStartStartTime specifies the start time, from the total time of the round, of Subround Start
const srStartStartTime = 0.0

Check failure on line 43 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `srStartStartTime` is unused (unused)

// srEndStartTime specifies the end time, from the total time of the round, of Subround Start
const srStartEndTime = 0.05

Check failure on line 46 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `srStartEndTime` is unused (unused)

// srBlockStartTime specifies the start time, from the total time of the round, of Subround Block
const srBlockStartTime = 0.05

Check failure on line 49 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `srBlockStartTime` is unused (unused)

// srBlockEndTime specifies the end time, from the total time of the round, of Subround Block
const srBlockEndTime = 0.45

Check failure on line 52 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `srBlockEndTime` is unused (unused)

// srSignatureStartTime specifies the start time, from the total time of the round, of Subround Signature
const srSignatureStartTime = 0.45

Check failure on line 55 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `srSignatureStartTime` is unused (unused)

// srSignatureEndTime specifies the end time, from the total time of the round, of Subround Signature
const srSignatureEndTime = 0.85

Check failure on line 58 in consensus/spos/bls/constants.go

View workflow job for this annotation

GitHub Actions / golangci linter

const `srSignatureEndTime` is unused (unused)

// srEndStartTime specifies the start time, from the total time of the round, of Subround End
const srEndStartTime = 0.85

// srEndEndTime specifies the end time, from the total time of the round, of Subround End
const srEndEndTime = 0.95

const (
// BlockBodyAndHeaderStringValue represents the string to be used to identify a block body and a block header
BlockBodyAndHeaderStringValue = "(BLOCK_BODY_AND_HEADER)"
Expand Down
33 changes: 5 additions & 28 deletions consensus/spos/consensusMessageValidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ func (cmv *consensusMessageValidator) checkConsensusMessageValidity(cnsMsg *cons
len(cnsMsg.PubKey))
}

if len(cnsMsg.Signature) != cmv.signatureSize {
return fmt.Errorf("%w : received signature from consensus topic has an invalid size: %d",
ErrInvalidSignatureSize,
len(cnsMsg.Signature))
}

isNodeInEligibleList := cmv.consensusState.IsNodeInEligibleList(string(cnsMsg.PubKey))
if !isNodeInEligibleList {
return fmt.Errorf("%w : received message from consensus topic has an invalid public key: %s",
Expand Down Expand Up @@ -404,11 +398,11 @@ func (cmv *consensusMessageValidator) checkMessageWithSignatureValidity(cnsMsg *
logger.DisplayByteSlice(cnsMsg.PubKey))
}

if len(cnsMsg.SignatureShare) != cmv.signatureSize {
return fmt.Errorf("%w : received signature share from consensus topic has an invalid size: %d",
ErrInvalidSignatureSize,
len(cnsMsg.SignatureShare))
}
//if len(cnsMsg.SignatureShare) != cmv.signatureSize {
// return fmt.Errorf("%w : received signature share from consensus topic has an invalid size: %d",
// ErrInvalidSignatureSize,
// len(cnsMsg.SignatureShare))
//}

return nil
}
Expand Down Expand Up @@ -437,23 +431,6 @@ func (cmv *consensusMessageValidator) checkMessageWithFinalInfoValidity(cnsMsg *
len(cnsMsg.PubKeysBitmap))
}

if len(cnsMsg.AggregateSignature) != cmv.signatureSize {
return fmt.Errorf("%w : received aggregate signature from consensus topic has an invalid size: %d",
ErrInvalidSignatureSize,
len(cnsMsg.AggregateSignature))
}

// TODO[cleanup cns finality]: remove this
if cmv.shouldNotVerifyLeaderSignature() {
return nil
}

if len(cnsMsg.LeaderSignature) != cmv.signatureSize {
return fmt.Errorf("%w : received leader signature from consensus topic has an invalid size: %d",
ErrInvalidSignatureSize,
len(cnsMsg.LeaderSignature))
}

return nil
}

Expand Down
36 changes: 6 additions & 30 deletions factory/crypto/cryptoComponents.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
disabledCrypto "github.com/multiversx/mx-chain-crypto-go/signing/disabled"
disabledSig "github.com/multiversx/mx-chain-crypto-go/signing/disabled/singlesig"
"github.com/multiversx/mx-chain-crypto-go/signing/ed25519"
"github.com/multiversx/mx-chain-crypto-go/signing/ed25519/singlesig"
"github.com/multiversx/mx-chain-crypto-go/signing/mcl"
mclSig "github.com/multiversx/mx-chain-crypto-go/signing/mcl/singlesig"
"github.com/multiversx/mx-chain-crypto-go/signing/secp256k1"
Expand Down Expand Up @@ -153,20 +152,21 @@ func (ccf *cryptoComponentsFactory) Create() (*cryptoComponents, error) {
}

txSignKeyGen := signing.NewKeyGenerator(ed25519.NewEd25519())
txSingleSigner := &singlesig.Ed25519Signer{}
processingSingleSigner, err := ccf.createSingleSigner(false)
txSingleSigner := &disabledSig.DisabledSingleSig{}

processingSingleSigner, err := ccf.createSingleSigner(true)
if err != nil {
return nil, err
}

interceptSingleSigner, err := ccf.createSingleSigner(ccf.importModeNoSigCheck)
interceptSingleSigner, err := ccf.createSingleSigner(true)
if err != nil {
return nil, err
}

p2pSingleSigner := &secp256k1SinglerSig.Secp256k1Signer{}

multiSigner, err := ccf.createMultiSignerContainer(blockSignKeyGen, ccf.importModeNoSigCheck)
multiSigner, err := ccf.createMultiSignerContainer(blockSignKeyGen, true)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -492,36 +492,12 @@ func (ccf *cryptoComponentsFactory) processAllHandledKeys(keygen crypto.KeyGener
return handledPrivateKeys, nil
}

func (ccf *cryptoComponentsFactory) processPrivatePublicKey(keygen crypto.KeyGenerator, encodedSk []byte, pkString string, index int) ([]byte, error) {
func (ccf *cryptoComponentsFactory) processPrivatePublicKey(_ crypto.KeyGenerator, encodedSk []byte, _ string, index int) ([]byte, error) {
skBytes, err := hex.DecodeString(string(encodedSk))
if err != nil {
return nil, fmt.Errorf("%w for encoded secret key, key index %d", err, index)
}

pkBytes, err := ccf.validatorPubKeyConverter.Decode(pkString)
if err != nil {
return nil, fmt.Errorf("%w for encoded public key %s, key index %d", err, pkString, index)
}

sk, err := keygen.PrivateKeyFromByteArray(skBytes)
if err != nil {
return nil, fmt.Errorf("%w secret key, key index %d", err, index)
}

pk := sk.GeneratePublic()
pkGeneratedBytes, err := pk.ToByteArray()
if err != nil {
return nil, fmt.Errorf("%w while generating public key bytes, key index %d", err, index)
}

if !bytes.Equal(pkGeneratedBytes, pkBytes) {
return nil, fmt.Errorf("public keys mismatch, read %s, generated %s, key index %d",
pkString,
ccf.validatorPubKeyConverter.SilentEncode(pkBytes, log),
index,
)
}

return skBytes, nil
}

Expand Down
3 changes: 3 additions & 0 deletions factory/peerSignatureHandler/peerSignatureHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func NewPeerSignatureHandler(
// VerifyPeerSignature verifies the signature associated with the public key. It first checks the cache for the public key,
// and if it is not present, it will recompute the signature.
func (psh *peerSignatureHandler) VerifyPeerSignature(pk []byte, pid core.PeerID, signature []byte) error {
if true {
return nil
}
if len(pk) == 0 {
return crypto.ErrInvalidPublicKey
}
Expand Down
25 changes: 17 additions & 8 deletions keysManagement/managedPeersHolder.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,24 @@ func generateNodeName(providedNodeName string, index int) string {
// It errors if the generated public key is already contained by the struct
// It will auto-generate some fields like the machineID and pid
func (holder *managedPeersHolder) AddManagedPeer(privateKeyBytes []byte) error {
privateKey, err := holder.keyGenerator.PrivateKeyFromByteArray(privateKeyBytes)
if err != nil {
return fmt.Errorf("%w for provided bytes %s", err, hex.EncodeToString(privateKeyBytes))
}
var publicKeyBytes []byte
var privateKey crypto.PrivateKey
var err error
actualPrivateKey := len(privateKeyBytes) == 32
if actualPrivateKey {
privateKey, err = holder.keyGenerator.PrivateKeyFromByteArray(privateKeyBytes)
if err != nil {
return fmt.Errorf("%w for provided bytes %s", err, hex.EncodeToString(privateKeyBytes))
}

publicKey := privateKey.GeneratePublic()
publicKeyBytes, err := publicKey.ToByteArray()
if err != nil {
return fmt.Errorf("%w for provided bytes %s", err, hex.EncodeToString(privateKeyBytes))
publicKey := privateKey.GeneratePublic()
publicKeyBytes, err = publicKey.ToByteArray()
if err != nil {
return fmt.Errorf("%w for provided bytes %s", err, hex.EncodeToString(privateKeyBytes))
}
} else {
publicKeyBytes = privateKeyBytes
privateKey, _ = holder.keyGenerator.GeneratePair()
}

p2pPrivateKey, p2pPublicKey := holder.p2pKeyGenerator.GeneratePair()
Expand Down
20 changes: 10 additions & 10 deletions node/external/transactionAPI/apiTransactionProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,16 @@ func (atp *apiTransactionProcessor) getRegularTransactionsFromPool(requestedFiel
func (atp *apiTransactionProcessor) getRewardTransactionsFromPool(requestedFieldsHandler fieldsHandler) ([]common.Transaction, error) {
rewardTxKeys := atp.dataPool.RewardTransactions().Keys()
rewardTxs := make([]common.Transaction, len(rewardTxKeys))
for idx, key := range rewardTxKeys {
txObj, found := atp.getRewardTxObjFromDataPool(key)
if !found {
continue
}

tx := atp.extractRequestedTxInfoFromObj(txObj, transaction.TxTypeReward, key, requestedFieldsHandler)

rewardTxs[idx] = tx
}
//for idx, key := range rewardTxKeys {
// txObj, found := atp.getRewardTxObjFromDataPool(key)
// if !found {
// continue
// }
//
// tx := atp.extractRequestedTxInfoFromObj(txObj, transaction.TxTypeReward, key, requestedFieldsHandler)
//
// rewardTxs[idx] = tx
//}

return rewardTxs, nil
}
Expand Down
2 changes: 1 addition & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ func (n *Node) ValidateTransaction(tx *transaction.Transaction) error {
return err
}

txValidator, intTx, err := n.commonTransactionValidation(tx, n.processComponents.WhiteListerVerifiedTxs(), n.processComponents.WhiteListHandler(), true)
txValidator, intTx, err := n.commonTransactionValidation(tx, n.processComponents.WhiteListerVerifiedTxs(), n.processComponents.WhiteListHandler(), false)
if err != nil {
return err
}
Expand Down
9 changes: 0 additions & 9 deletions process/block/headerValidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,6 @@ func (h *headerValidator) IsHeaderConstructionValid(currHeader, prevHeader data.
return process.ErrBlockHashDoesNotMatch
}

if !bytes.Equal(currHeader.GetPrevRandSeed(), prevHeader.GetRandSeed()) {
log.Trace("header random seed does not match",
"shard", currHeader.GetShardID(),
"local header random seed", prevHeader.GetRandSeed(),
"received header with prev random seed", currHeader.GetPrevRandSeed(),
)
return process.ErrRandSeedDoesNotMatch
}

return nil
}

Expand Down
Loading
Loading