From 5631405d2902108423a8c94ac8c4db995b29383a Mon Sep 17 00:00:00 2001 From: radu chis Date: Tue, 5 Sep 2023 16:59:13 +0300 Subject: [PATCH 01/31] SF-v1.6.0 initial test --- consensus/spos/bls/constants.go | 4 +-- consensus/spos/consensusMessageValidator.go | 18 ---------- factory/crypto/cryptoComponents.go | 33 +++---------------- keysManagement/managedPeersHolder.go | 14 ++------ node/node.go | 4 +-- process/block/headerValidator.go | 9 ----- .../interceptedPeerAuthentication.go | 17 ---------- process/transaction/baseProcess.go | 6 ++++ 8 files changed, 18 insertions(+), 87 deletions(-) diff --git a/consensus/spos/bls/constants.go b/consensus/spos/bls/constants.go index 166abe70b65..afab1721a2a 100644 --- a/consensus/spos/bls/constants.go +++ b/consensus/spos/bls/constants.go @@ -52,10 +52,10 @@ const srStartEndTime = 0.05 const srBlockStartTime = 0.05 // srBlockEndTime specifies the end time, from the total time of the round, of Subround Block -const srBlockEndTime = 0.25 +const srBlockEndTime = 0.45 // srSignatureStartTime specifies the start time, from the total time of the round, of Subround Signature -const srSignatureStartTime = 0.25 +const srSignatureStartTime = 0.45 // srSignatureEndTime specifies the end time, from the total time of the round, of Subround Signature const srSignatureEndTime = 0.85 diff --git a/consensus/spos/consensusMessageValidator.go b/consensus/spos/consensusMessageValidator.go index 67fa9616e07..2d49c59792a 100644 --- a/consensus/spos/consensusMessageValidator.go +++ b/consensus/spos/consensusMessageValidator.go @@ -122,12 +122,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", @@ -392,18 +386,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)) - } - - 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 } diff --git a/factory/crypto/cryptoComponents.go b/factory/crypto/cryptoComponents.go index 153f5486bd4..c8c01974269 100644 --- a/factory/crypto/cryptoComponents.go +++ b/factory/crypto/cryptoComponents.go @@ -158,19 +158,20 @@ func (ccf *cryptoComponentsFactory) Create() (*cryptoComponents, error) { txSignKeyGen := signing.NewKeyGenerator(ed25519.NewEd25519()) txSingleSigner := &singlesig.Ed25519Signer{} - processingSingleSigner, err := ccf.createSingleSigner(false) + + 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 } @@ -489,36 +490,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 } diff --git a/keysManagement/managedPeersHolder.go b/keysManagement/managedPeersHolder.go index 0cc7ea8c9e6..1e37df14cdf 100644 --- a/keysManagement/managedPeersHolder.go +++ b/keysManagement/managedPeersHolder.go @@ -113,16 +113,8 @@ func createDataMap(namedIdentities []config.NamedIdentity) (map[string]*peerInfo // 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)) - } - - publicKey := privateKey.GeneratePublic() - publicKeyBytes, err := publicKey.ToByteArray() - if err != nil { - return fmt.Errorf("%w for provided bytes %s", err, hex.EncodeToString(privateKeyBytes)) - } + sk, _ := holder.keyGenerator.GeneratePair() + publicKeyBytes := privateKeyBytes p2pPrivateKey, p2pPublicKey := holder.p2pKeyGenerator.GeneratePair() @@ -155,7 +147,7 @@ func (holder *managedPeersHolder) AddManagedPeer(privateKeyBytes []byte) error { pInfo.pid = pid pInfo.p2pPrivateKeyBytes = p2pPrivateKeyBytes - pInfo.privateKey = privateKey + pInfo.privateKey = sk holder.data[string(publicKeyBytes)] = pInfo holder.pids[pid] = struct{}{} diff --git a/node/node.go b/node/node.go index e02f84be2cb..12f6e9085ee 100644 --- a/node/node.go +++ b/node/node.go @@ -54,7 +54,7 @@ var log = logger.GetOrCreate("node") var _ facade.NodeHandler = (*Node)(nil) // Option represents a functional configuration parameter that can operate -// over the None struct. +// over the None struct. type Option func(*Node) error type filter interface { @@ -700,7 +700,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 } diff --git a/process/block/headerValidator.go b/process/block/headerValidator.go index b39787c7a96..67499767b83 100644 --- a/process/block/headerValidator.go +++ b/process/block/headerValidator.go @@ -78,15 +78,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 } diff --git a/process/heartbeat/interceptedPeerAuthentication.go b/process/heartbeat/interceptedPeerAuthentication.go index a10e5e6dd8d..48cccdc3e11 100644 --- a/process/heartbeat/interceptedPeerAuthentication.go +++ b/process/heartbeat/interceptedPeerAuthentication.go @@ -136,23 +136,6 @@ func (ipa *interceptedPeerAuthentication) CheckValidity() error { } // Verify payload signature - err = ipa.signaturesHandler.Verify(ipa.peerAuthentication.Payload, ipa.peerId, ipa.peerAuthentication.PayloadSignature) - if err != nil { - return err - } - - // Verify payload - err = ipa.payloadValidator.ValidateTimestamp(ipa.payload.Timestamp) - if err != nil { - return err - } - - // Verify message bls signature - err = ipa.peerSignatureHandler.VerifyPeerSignature(ipa.peerAuthentication.Pubkey, ipa.peerId, ipa.peerAuthentication.Signature) - if err != nil { - return err - } - log.Trace("interceptedPeerAuthentication received valid data") return nil diff --git a/process/transaction/baseProcess.go b/process/transaction/baseProcess.go index 7f2fe6d4b16..176e9abbb3c 100644 --- a/process/transaction/baseProcess.go +++ b/process/transaction/baseProcess.go @@ -267,6 +267,12 @@ func (txProc *baseTxProcessor) verifyGuardian(tx *transaction.Transaction, accou if check.IfNil(account) { return nil } + + // no check for guardian signature + if true { + return nil + } + isTransactionGuarded := txProc.txVersionChecker.IsGuardedTransaction(tx) if !account.IsGuarded() { if isTransactionGuarded { From 91774dc5ddb70cd2de3a6d55fae3af8615118da7 Mon Sep 17 00:00:00 2001 From: radu chis Date: Thu, 7 Sep 2023 13:50:08 +0300 Subject: [PATCH 02/31] set singlesigner to disabled --- factory/crypto/cryptoComponents.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/factory/crypto/cryptoComponents.go b/factory/crypto/cryptoComponents.go index c8c01974269..d88de2c5eda 100644 --- a/factory/crypto/cryptoComponents.go +++ b/factory/crypto/cryptoComponents.go @@ -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" @@ -157,7 +156,7 @@ func (ccf *cryptoComponentsFactory) Create() (*cryptoComponents, error) { } txSignKeyGen := signing.NewKeyGenerator(ed25519.NewEd25519()) - txSingleSigner := &singlesig.Ed25519Signer{} + txSingleSigner := &disabledSig.DisabledSingleSig{} processingSingleSigner, err := ccf.createSingleSigner(true) if err != nil { From 075e96029aac7fadb91b795e7003a7382038fbd7 Mon Sep 17 00:00:00 2001 From: radu chis Date: Fri, 8 Sep 2023 12:22:15 +0300 Subject: [PATCH 03/31] do not check peerSignature --- factory/peerSignatureHandler/peerSignatureHandler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/factory/peerSignatureHandler/peerSignatureHandler.go b/factory/peerSignatureHandler/peerSignatureHandler.go index 49518631bf7..7fb84e8761b 100644 --- a/factory/peerSignatureHandler/peerSignatureHandler.go +++ b/factory/peerSignatureHandler/peerSignatureHandler.go @@ -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 } From 19d6b8869a91dfb4a41a50bd1de6fd3db4c118e2 Mon Sep 17 00:00:00 2001 From: radu chis Date: Mon, 11 Sep 2023 15:20:05 +0300 Subject: [PATCH 04/31] added epochsFastForward --- process/block/metablock.go | 77 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/process/block/metablock.go b/process/block/metablock.go index 810a240c1b3..83284707cb3 100644 --- a/process/block/metablock.go +++ b/process/block/metablock.go @@ -5,6 +5,8 @@ import ( "encoding/hex" "fmt" "math/big" + "strconv" + "strings" "sync" "time" @@ -20,10 +22,13 @@ import ( "github.com/multiversx/mx-chain-go/process/block/bootstrapStorage" "github.com/multiversx/mx-chain-go/process/block/processedMb" "github.com/multiversx/mx-chain-go/state" + "github.com/multiversx/mx-chain-go/update" + "github.com/multiversx/mx-chain-go/vm" logger "github.com/multiversx/mx-chain-logger-go" ) const firstHeaderNonce = uint64(1) +const minRoundModulus = uint64(4) var _ process.BlockProcessor = (*metaProcessor)(nil) @@ -42,6 +47,9 @@ type metaProcessor struct { shardBlockFinality uint32 chRcvAllHdrs chan bool headersCounter *headersCounter + nrEpochsChanges int + roundsModulus uint64 + shouldStartBootstrap bool } // NewMetaProcessor creates a new metaProcessor object @@ -176,6 +184,9 @@ func NewMetaProcessor(arguments ArgMetaProcessor) (*metaProcessor, error) { mp.shardsHeadersNonce = &sync.Map{} + mp.nrEpochsChanges = 0 + mp.roundsModulus = 20 + return &mp, nil } @@ -404,6 +415,8 @@ func (mp *metaProcessor) ProcessBlock( return err } + mp.ForceStart(header) + return nil } @@ -768,6 +781,8 @@ func (mp *metaProcessor) CreateBlock( mp.requestHandler.SetEpoch(metaHdr.GetEpoch()) + mp.ForceStart(metaHdr) + return metaHdr, body, nil } @@ -2533,3 +2548,65 @@ func (mp *metaProcessor) DecodeBlockHeader(dta []byte) data.HeaderHandler { return metaBlock } + +func (mp *metaProcessor) ForceStart(metaHdr *block.MetaBlock) { + forceEpochTrigger := mp.epochStartTrigger.(update.EpochHandler) + + txBlockTxs := mp.txCoordinator.GetAllCurrentUsedTxs(block.TxBlock) + + for _, tx := range txBlockTxs { + if bytes.Compare(tx.GetRcvAddr(), vm.ValidatorSCAddress) == 0 { + tokens := strings.Split(string(tx.GetData()), "@") + if len(tokens) == 0 { + continue + } + done := false + switch tokens[0] { + case "epochsFastForward": + { + if len(tokens) != 3 { + log.Error("epochsFastForward", "invalid data", string(tx.GetData())) + continue + } + mp.epochsFastForward(metaHdr, tokens) + done = true + } + } + + if done { + break + } + } + } + + if !check.IfNil(forceEpochTrigger) { + if metaHdr.GetRound()%mp.roundsModulus == 0 && mp.nrEpochsChanges > 0 { + forceEpochTrigger.ForceEpochStart(metaHdr.GetRound()) + mp.nrEpochsChanges-- + log.Debug("forcing epoch start", "round", metaHdr.GetRound(), "epoch", metaHdr.GetEpoch(), "still remaining epoch changes", mp.nrEpochsChanges, "rounds modulus", mp.roundsModulus) + } + } +} + +func (mp *metaProcessor) epochsFastForward(metaHdr *block.MetaBlock, tokens []string) { + epochs, err := strconv.ParseInt(tokens[1], 10, 64) + if err != nil { + log.Error("epochfastforward", "epochs could not be parsed", tokens[1]) + } + + roundsPerEpoch, err := strconv.ParseInt(tokens[2], 10, 64) + if err != nil { + log.Error("epochfastforward", "rounds could not be parsed", tokens[2]) + } + roundsPerEpochUint := uint64(roundsPerEpoch) + + if roundsPerEpochUint < minRoundModulus { + log.Warn("epochfastforward rounds per epoch too small", "rounds", roundsPerEpoch, "minRoundModulus", minRoundModulus) + roundsPerEpochUint = minRoundModulus + } + + mp.nrEpochsChanges = int(epochs) + mp.roundsModulus = roundsPerEpochUint + + log.Warn("epochfastforward - forcing epoch start", "round", metaHdr.GetRound(), "epoch", metaHdr.GetEpoch(), "still remaining epoch changes", mp.nrEpochsChanges, "rounds modulus", mp.roundsModulus) +} From d8d459ef77233fbd7ad2c112992fe00ab8622996 Mon Sep 17 00:00:00 2001 From: radu chis Date: Wed, 17 Jan 2024 18:16:31 +0200 Subject: [PATCH 05/31] MaxTxNonceDeltaAllowed = 100000 --- common/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/constants.go b/common/constants.go index 223dcebd189..8442808d622 100644 --- a/common/constants.go +++ b/common/constants.go @@ -54,7 +54,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 From af69ba11544a8a79ec16c183f603ef73d4253067 Mon Sep 17 00:00:00 2001 From: robertsasu Date: Wed, 14 May 2025 14:37:45 +0300 Subject: [PATCH 06/31] revert go mod --- go.mod | 4 +--- go.sum | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index a2ef0c5a308..7981585838b 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,5 @@ module github.com/multiversx/mx-chain-go -go 1.20 - require ( github.com/beevik/ntp v1.3.0 github.com/davecgh/go-spew v1.1.1 @@ -22,7 +20,7 @@ require ( github.com/multiversx/mx-chain-scenario-go v1.4.4 github.com/multiversx/mx-chain-storage-go v1.0.19 github.com/multiversx/mx-chain-vm-common-go v1.5.16 - github.com/multiversx/mx-chain-vm-go v1.5.37 + github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514113344-d24aa291656a github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69 github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98 diff --git a/go.sum b/go.sum index 2f118d35702..946f62d8820 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,7 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= @@ -112,10 +113,12 @@ github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwU github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -142,6 +145,7 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -165,6 +169,7 @@ github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -197,6 +202,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -217,6 +223,7 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= +github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= @@ -247,6 +254,7 @@ github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8 github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= +github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= @@ -287,6 +295,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -314,6 +323,7 @@ github.com/libp2p/go-libp2p-pubsub v0.9.3/go.mod h1:RYA7aM9jIic5VV47WXu4GkcRxRhr github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0= github.com/libp2p/go-libp2p-record v0.2.0/go.mod h1:I+3zMkvvg5m2OcSdoL0KPljyJyvNDFGKX7QdlpYUcwk= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= +github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk= @@ -405,8 +415,8 @@ github.com/multiversx/mx-chain-storage-go v1.0.19 h1:2R35MoSXcuNJOFmV5xEhcXqiEGZ github.com/multiversx/mx-chain-storage-go v1.0.19/go.mod h1:Pb/BuVmiFqO66DSZO16KFkSUeom94x3e3Q9IloBvkYI= github.com/multiversx/mx-chain-vm-common-go v1.5.16 h1:g1SqYjxl7K66Y1O/q6tvDJ37fzpzlxCSfRzSm/woQQY= github.com/multiversx/mx-chain-vm-common-go v1.5.16/go.mod h1:1rSkXreUZNXyPTTdhj47M+Fy62yjxbu3aAsXEtKN3UY= -github.com/multiversx/mx-chain-vm-go v1.5.37 h1:Iy3KCvM+DOq1f9UPA7uYK/rI3ZbBOXc2CVNO2/vm5zw= -github.com/multiversx/mx-chain-vm-go v1.5.37/go.mod h1:nzLrWeXvfxCIiwj5uNBZq3d7stkXyeY+Fktfr4tTaiY= +github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514113344-d24aa291656a h1:QW8MCD7gijKH9toYB/1KyKyuq7vpbrlQg/Dr4hs4ufU= +github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514113344-d24aa291656a/go.mod h1:nzLrWeXvfxCIiwj5uNBZq3d7stkXyeY+Fktfr4tTaiY= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68 h1:L3GoAVFtLLzr9ya0rVv1YdTUzS3MyM7kQNBSAjCNO2g= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68/go.mod h1:ixxwib+1pXwSDHG5Wa34v0SRScF+BwFzH4wFWY31saI= github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69 h1:G/PLsyfQV4bMLs2amGRvaLKZoW1DC7M+7ecVaLuaCNc= @@ -441,6 +451,7 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= +github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -490,6 +501,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -604,6 +616,7 @@ go.uber.org/fx v1.19.2 h1:SyFgYQFr1Wl0AYstE8vyYIzP4bFz2URrScjwC4cwUvY= go.uber.org/fx v1.19.2/go.mod h1:43G1VcqSzbIv77y00p1DRAsyZS8WdzuYdhZXmEUkMyQ= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= From d9f7ad461c029ddf4634642880466776106b6f60 Mon Sep 17 00:00:00 2001 From: robertsasu Date: Wed, 14 May 2025 14:52:47 +0300 Subject: [PATCH 07/31] revert go mod --- go.mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 7981585838b..18c5d01770a 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/multiversx/mx-chain-scenario-go v1.4.4 github.com/multiversx/mx-chain-storage-go v1.0.19 github.com/multiversx/mx-chain-vm-common-go v1.5.16 - github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514113344-d24aa291656a + github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514115020-3038b356bbb3 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69 github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98 @@ -170,6 +170,7 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/dig v1.17.0 // indirect go.uber.org/fx v1.19.2 // indirect + go.uber.org/goleak v1.2.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/arch v0.8.0 // indirect From 023df75e811e68de9235e8fb4ecc180bd43d3fce Mon Sep 17 00:00:00 2001 From: robertsasu Date: Wed, 14 May 2025 15:16:41 +0300 Subject: [PATCH 08/31] revert go mod --- go.mod | 2 ++ go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 18c5d01770a..d27de77e2b8 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/multiversx/mx-chain-go +go 1.20 + require ( github.com/beevik/ntp v1.3.0 github.com/davecgh/go-spew v1.1.1 diff --git a/go.sum b/go.sum index 946f62d8820..5d1414a9fe6 100644 --- a/go.sum +++ b/go.sum @@ -415,8 +415,8 @@ github.com/multiversx/mx-chain-storage-go v1.0.19 h1:2R35MoSXcuNJOFmV5xEhcXqiEGZ github.com/multiversx/mx-chain-storage-go v1.0.19/go.mod h1:Pb/BuVmiFqO66DSZO16KFkSUeom94x3e3Q9IloBvkYI= github.com/multiversx/mx-chain-vm-common-go v1.5.16 h1:g1SqYjxl7K66Y1O/q6tvDJ37fzpzlxCSfRzSm/woQQY= github.com/multiversx/mx-chain-vm-common-go v1.5.16/go.mod h1:1rSkXreUZNXyPTTdhj47M+Fy62yjxbu3aAsXEtKN3UY= -github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514113344-d24aa291656a h1:QW8MCD7gijKH9toYB/1KyKyuq7vpbrlQg/Dr4hs4ufU= -github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514113344-d24aa291656a/go.mod h1:nzLrWeXvfxCIiwj5uNBZq3d7stkXyeY+Fktfr4tTaiY= +github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514115020-3038b356bbb3 h1:MrCAPEUJBOzgb0usFcUTYBul7Jp25SqBl8FxCKi/ZLA= +github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514115020-3038b356bbb3/go.mod h1:nzLrWeXvfxCIiwj5uNBZq3d7stkXyeY+Fktfr4tTaiY= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68 h1:L3GoAVFtLLzr9ya0rVv1YdTUzS3MyM7kQNBSAjCNO2g= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68/go.mod h1:ixxwib+1pXwSDHG5Wa34v0SRScF+BwFzH4wFWY31saI= github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69 h1:G/PLsyfQV4bMLs2amGRvaLKZoW1DC7M+7ecVaLuaCNc= @@ -615,8 +615,8 @@ go.uber.org/dig v1.17.0/go.mod h1:rTxpf7l5I0eBTlE6/9RL+lDybC7WFwY2QH55ZSjy1mU= go.uber.org/fx v1.19.2 h1:SyFgYQFr1Wl0AYstE8vyYIzP4bFz2URrScjwC4cwUvY= go.uber.org/fx v1.19.2/go.mod h1:43G1VcqSzbIv77y00p1DRAsyZS8WdzuYdhZXmEUkMyQ= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= From ba344232dcea9e7560ed48120e9465a2ee217370 Mon Sep 17 00:00:00 2001 From: robertsasu Date: Wed, 14 May 2025 15:39:02 +0300 Subject: [PATCH 09/31] revert go mod --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d27de77e2b8..30efe563366 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/multiversx/mx-chain-scenario-go v1.4.4 github.com/multiversx/mx-chain-storage-go v1.0.19 github.com/multiversx/mx-chain-vm-common-go v1.5.16 - github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514115020-3038b356bbb3 + github.com/multiversx/mx-chain-vm-go v1.5.39 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68 github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69 github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98 diff --git a/go.sum b/go.sum index 5d1414a9fe6..ddeaa3204c9 100644 --- a/go.sum +++ b/go.sum @@ -415,8 +415,8 @@ github.com/multiversx/mx-chain-storage-go v1.0.19 h1:2R35MoSXcuNJOFmV5xEhcXqiEGZ github.com/multiversx/mx-chain-storage-go v1.0.19/go.mod h1:Pb/BuVmiFqO66DSZO16KFkSUeom94x3e3Q9IloBvkYI= github.com/multiversx/mx-chain-vm-common-go v1.5.16 h1:g1SqYjxl7K66Y1O/q6tvDJ37fzpzlxCSfRzSm/woQQY= github.com/multiversx/mx-chain-vm-common-go v1.5.16/go.mod h1:1rSkXreUZNXyPTTdhj47M+Fy62yjxbu3aAsXEtKN3UY= -github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514115020-3038b356bbb3 h1:MrCAPEUJBOzgb0usFcUTYBul7Jp25SqBl8FxCKi/ZLA= -github.com/multiversx/mx-chain-vm-go v1.5.38-0.20250514115020-3038b356bbb3/go.mod h1:nzLrWeXvfxCIiwj5uNBZq3d7stkXyeY+Fktfr4tTaiY= +github.com/multiversx/mx-chain-vm-go v1.5.39 h1:ZRKT50U7nvzEqNoigq/GkZFJDSXODkQVlPU0kJX9HOM= +github.com/multiversx/mx-chain-vm-go v1.5.39/go.mod h1:nzLrWeXvfxCIiwj5uNBZq3d7stkXyeY+Fktfr4tTaiY= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68 h1:L3GoAVFtLLzr9ya0rVv1YdTUzS3MyM7kQNBSAjCNO2g= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68/go.mod h1:ixxwib+1pXwSDHG5Wa34v0SRScF+BwFzH4wFWY31saI= github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69 h1:G/PLsyfQV4bMLs2amGRvaLKZoW1DC7M+7ecVaLuaCNc= From f9556014917657c873cd6434feb681a185bdefff Mon Sep 17 00:00:00 2001 From: radu Date: Mon, 25 Aug 2025 11:16:23 +0300 Subject: [PATCH 10/31] sfEnableRoundsHandler.go --- common/enablers/sfEnableRoundsHandler.go | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 common/enablers/sfEnableRoundsHandler.go diff --git a/common/enablers/sfEnableRoundsHandler.go b/common/enablers/sfEnableRoundsHandler.go new file mode 100644 index 00000000000..592558a4933 --- /dev/null +++ b/common/enablers/sfEnableRoundsHandler.go @@ -0,0 +1,33 @@ +package enablers + +import ( + "github.com/multiversx/mx-chain-go/common" + "github.com/multiversx/mx-chain-go/config" + "github.com/multiversx/mx-chain-go/process" +) + +type sfEnableRoundsHandler struct { + enableRoundsHandler *enableRoundsHandler +} + +func NewSFEnableRoundsHandler(roundsConfig config.RoundConfig, roundNotifier process.RoundNotifier) (*sfEnableRoundsHandler, error) { + handler := &enableRoundsHandler{} + err := handler.createAllFlagsMap(roundsConfig) + if err != nil { + return nil, err + } + + roundNotifier.RegisterNotifyHandler(handler) + + return &sfEnableRoundsHandler{handler}, nil +} + +func (sf *sfEnableRoundsHandler) SetSuperNovaActivationRound(round uint64) { + log.Info("SetSuperNovaActivationRound - entered", "round", round) + superNovaRound, ok := sf.enableRoundsHandler.allFlagsDefined[common.SupernovaRoundFlag] + if ok { + log.Info("SetSuperNovaActivationRound", "round", round) + superNovaRound.activationRound = round + } + log.Info("SetSuperNovaActivationRound - exited", "round", round) +} From 17828968750e6259da92214cccdf48b5ed3fb44c Mon Sep 17 00:00:00 2001 From: radu Date: Mon, 25 Aug 2025 16:32:45 +0300 Subject: [PATCH 11/31] added epochRoundsHandler setActivationEpoch --- common/common.go | 14 ++++++++++ common/enablers/enableRoundsHandler.go | 11 ++++++++ common/enablers/sfEnableRoundsHandler.go | 33 ------------------------ epochStart/metachain/trigger.go | 1 + epochStart/shardchain/trigger.go | 1 + factory/core/coreComponents.go | 2 ++ 6 files changed, 29 insertions(+), 33 deletions(-) delete mode 100644 common/enablers/sfEnableRoundsHandler.go diff --git a/common/common.go b/common/common.go index ca93fd4cfb7..6653062b579 100644 --- a/common/common.go +++ b/common/common.go @@ -242,3 +242,17 @@ func GetHeaderTimestamps( return timestampSec, timestampMs, nil } + +type EnableEpochsHandlerWithSet interface { + SetActivationRound(flag EnableRoundFlag, round uint64) +} + +var erh EnableEpochsHandlerWithSet + +func SetEnableRoundsHandler(enableRoundsHandler EnableEpochsHandlerWithSet) { + erh = enableRoundsHandler +} + +func SetSuperNovaActivationRound(round uint64) { + erh.SetActivationRound(SupernovaRoundFlag, round) +} diff --git a/common/enablers/enableRoundsHandler.go b/common/enablers/enableRoundsHandler.go index 5926b3a98fe..cf7b542b3d8 100644 --- a/common/enablers/enableRoundsHandler.go +++ b/common/enablers/enableRoundsHandler.go @@ -174,3 +174,14 @@ func (handler *enableRoundsHandler) GetActivationRound(flag common.EnableRoundFl func (handler *enableRoundsHandler) IsInterfaceNil() bool { return handler == nil } + +// SetActivationRound sets the activation round of the provided flag +func (handler *enableRoundsHandler) SetActivationRound(flag common.EnableRoundFlag, round uint64) { + handler.allFlagsDefined[flag] = roundFlagHandler{ + isActiveInRound: func(r uint64) bool { + return r >= round + }, + activationRound: round, + } + log.Debug("SetActivationRound", "flag", flag, "round", round) +} diff --git a/common/enablers/sfEnableRoundsHandler.go b/common/enablers/sfEnableRoundsHandler.go deleted file mode 100644 index 592558a4933..00000000000 --- a/common/enablers/sfEnableRoundsHandler.go +++ /dev/null @@ -1,33 +0,0 @@ -package enablers - -import ( - "github.com/multiversx/mx-chain-go/common" - "github.com/multiversx/mx-chain-go/config" - "github.com/multiversx/mx-chain-go/process" -) - -type sfEnableRoundsHandler struct { - enableRoundsHandler *enableRoundsHandler -} - -func NewSFEnableRoundsHandler(roundsConfig config.RoundConfig, roundNotifier process.RoundNotifier) (*sfEnableRoundsHandler, error) { - handler := &enableRoundsHandler{} - err := handler.createAllFlagsMap(roundsConfig) - if err != nil { - return nil, err - } - - roundNotifier.RegisterNotifyHandler(handler) - - return &sfEnableRoundsHandler{handler}, nil -} - -func (sf *sfEnableRoundsHandler) SetSuperNovaActivationRound(round uint64) { - log.Info("SetSuperNovaActivationRound - entered", "round", round) - superNovaRound, ok := sf.enableRoundsHandler.allFlagsDefined[common.SupernovaRoundFlag] - if ok { - log.Info("SetSuperNovaActivationRound", "round", round) - superNovaRound.activationRound = round - } - log.Info("SetSuperNovaActivationRound - exited", "round", round) -} diff --git a/epochStart/metachain/trigger.go b/epochStart/metachain/trigger.go index 992decd663c..d9cf544b348 100644 --- a/epochStart/metachain/trigger.go +++ b/epochStart/metachain/trigger.go @@ -234,6 +234,7 @@ func (t *trigger) Update(round uint64, nonce uint64) { t.currEpochStartRound = t.currentRound msg := fmt.Sprintf("EPOCH %d BEGINS IN ROUND (%d)", t.epoch, t.currentRound) + common.SetSuperNovaActivationRound(t.currentRound) log.Debug(display.Headline(msg, "", "#")) log.Debug("trigger.Update", "isEpochStart", t.isEpochStart) logger.SetCorrelationEpoch(t.epoch) diff --git a/epochStart/shardchain/trigger.go b/epochStart/shardchain/trigger.go index e6100f3ab3b..a4e5af679bf 100644 --- a/epochStart/shardchain/trigger.go +++ b/epochStart/shardchain/trigger.go @@ -738,6 +738,7 @@ func (t *trigger) updateTriggerFromMeta() { t.epochStartNotifier.NotifyEpochChangeConfirmed(t.metaEpoch) msg := fmt.Sprintf("EPOCH %d BEGINS IN ROUND (%d)", t.metaEpoch, t.epochStartRound) + common.SetSuperNovaActivationRound(t.epochStartRound) log.Debug(display.Headline(msg, "", "#")) log.Debug("trigger.updateTriggerFromMeta", "isEpochStart", t.isEpochStart) logger.SetCorrelationEpoch(t.metaEpoch) diff --git a/factory/core/coreComponents.go b/factory/core/coreComponents.go index 846e57cc9bc..949954137a4 100644 --- a/factory/core/coreComponents.go +++ b/factory/core/coreComponents.go @@ -212,6 +212,8 @@ func (ccf *coreComponentsFactory) Create() (*coreComponents, error) { return nil, err } + common.SetEnableRoundsHandler(enableRoundsHandler) + genesisNodesConfig, err := sharding.NewNodesSetup( ccf.nodesSetupConfig, chainParametersHandler, From 73599400113feec66db692277ad113eae8d93a1b Mon Sep 17 00:00:00 2001 From: radu Date: Tue, 26 Aug 2025 17:21:51 +0300 Subject: [PATCH 12/31] more optimizations for setActivationRound --- common/common.go | 15 +++++++++++++-- common/enablers/enableRoundsHandler.go | 4 ++++ epochStart/metachain/trigger.go | 2 +- epochStart/shardchain/trigger.go | 2 +- factory/core/coreComponents.go | 1 + 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/common/common.go b/common/common.go index 6653062b579..79a605fc717 100644 --- a/common/common.go +++ b/common/common.go @@ -248,11 +248,22 @@ type EnableEpochsHandlerWithSet interface { } var erh EnableEpochsHandlerWithSet +var eeh EnableEpochsHandler +var log = logger.GetOrCreate("common") func SetEnableRoundsHandler(enableRoundsHandler EnableEpochsHandlerWithSet) { erh = enableRoundsHandler } -func SetSuperNovaActivationRound(round uint64) { - erh.SetActivationRound(SupernovaRoundFlag, round) +func SetEnableEpochsHandler(enableEpochsHandler EnableEpochsHandler) { + eeh = enableEpochsHandler +} + +func SetSuperNovaActivationRound(epoch uint32, round uint64) { + isEnabled := eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) + log.Info("SetSuperNovaActivationRound", "round", round, "epoch", epoch, "is enabled", isEnabled) + if isEnabled { + erh.SetActivationRound(SupernovaRoundFlag, round) + } + } diff --git a/common/enablers/enableRoundsHandler.go b/common/enablers/enableRoundsHandler.go index cf7b542b3d8..26883a4d25e 100644 --- a/common/enablers/enableRoundsHandler.go +++ b/common/enablers/enableRoundsHandler.go @@ -177,6 +177,10 @@ func (handler *enableRoundsHandler) IsInterfaceNil() bool { // SetActivationRound sets the activation round of the provided flag func (handler *enableRoundsHandler) SetActivationRound(flag common.EnableRoundFlag, round uint64) { + if flag == common.SupernovaRoundFlag { + round = round + 50 + } + handler.allFlagsDefined[flag] = roundFlagHandler{ isActiveInRound: func(r uint64) bool { return r >= round diff --git a/epochStart/metachain/trigger.go b/epochStart/metachain/trigger.go index d9cf544b348..04111b5e40b 100644 --- a/epochStart/metachain/trigger.go +++ b/epochStart/metachain/trigger.go @@ -234,7 +234,7 @@ func (t *trigger) Update(round uint64, nonce uint64) { t.currEpochStartRound = t.currentRound msg := fmt.Sprintf("EPOCH %d BEGINS IN ROUND (%d)", t.epoch, t.currentRound) - common.SetSuperNovaActivationRound(t.currentRound) + common.SetSuperNovaActivationRound(t.epoch, t.currentRound) log.Debug(display.Headline(msg, "", "#")) log.Debug("trigger.Update", "isEpochStart", t.isEpochStart) logger.SetCorrelationEpoch(t.epoch) diff --git a/epochStart/shardchain/trigger.go b/epochStart/shardchain/trigger.go index a4e5af679bf..76ec075d678 100644 --- a/epochStart/shardchain/trigger.go +++ b/epochStart/shardchain/trigger.go @@ -738,7 +738,7 @@ func (t *trigger) updateTriggerFromMeta() { t.epochStartNotifier.NotifyEpochChangeConfirmed(t.metaEpoch) msg := fmt.Sprintf("EPOCH %d BEGINS IN ROUND (%d)", t.metaEpoch, t.epochStartRound) - common.SetSuperNovaActivationRound(t.epochStartRound) + common.SetSuperNovaActivationRound(t.metaEpoch, t.epochStartRound) log.Debug(display.Headline(msg, "", "#")) log.Debug("trigger.updateTriggerFromMeta", "isEpochStart", t.isEpochStart) logger.SetCorrelationEpoch(t.metaEpoch) diff --git a/factory/core/coreComponents.go b/factory/core/coreComponents.go index 949954137a4..0fd79294525 100644 --- a/factory/core/coreComponents.go +++ b/factory/core/coreComponents.go @@ -212,6 +212,7 @@ func (ccf *coreComponentsFactory) Create() (*coreComponents, error) { return nil, err } + common.SetEnableEpochsHandler(enableEpochsHandler) common.SetEnableRoundsHandler(enableRoundsHandler) genesisNodesConfig, err := sharding.NewNodesSetup( From 9ad06914f07d82e9e39a947f5d4cd66875cb625a Mon Sep 17 00:00:00 2001 From: radu Date: Thu, 28 Aug 2025 12:03:45 +0300 Subject: [PATCH 13/31] fix supernova round activation --- common/common.go | 2 +- common/enablers/enableRoundsHandler.go | 4 ---- consensus/round/round.go | 23 +++++++++++++++++++--- consensus/spos/bls/v1/subroundSignature.go | 2 +- consensus/spos/bls/v2/subroundSignature.go | 2 +- process/sync/baseForkDetector.go | 21 +++++++++++++++++--- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/common/common.go b/common/common.go index 79a605fc717..e4c4864f2e4 100644 --- a/common/common.go +++ b/common/common.go @@ -263,7 +263,7 @@ func SetSuperNovaActivationRound(epoch uint32, round uint64) { isEnabled := eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) log.Info("SetSuperNovaActivationRound", "round", round, "epoch", epoch, "is enabled", isEnabled) if isEnabled { - erh.SetActivationRound(SupernovaRoundFlag, round) + erh.SetActivationRound(SupernovaRoundFlag, round+20) } } diff --git a/common/enablers/enableRoundsHandler.go b/common/enablers/enableRoundsHandler.go index 26883a4d25e..cf7b542b3d8 100644 --- a/common/enablers/enableRoundsHandler.go +++ b/common/enablers/enableRoundsHandler.go @@ -177,10 +177,6 @@ func (handler *enableRoundsHandler) IsInterfaceNil() bool { // SetActivationRound sets the activation round of the provided flag func (handler *enableRoundsHandler) SetActivationRound(flag common.EnableRoundFlag, round uint64) { - if flag == common.SupernovaRoundFlag { - round = round + 50 - } - handler.allFlagsDefined[flag] = roundFlagHandler{ isActiveInRound: func(r uint64) bool { return r >= round diff --git a/consensus/round/round.go b/consensus/round/round.go index 71866e1d8f8..c0631b8e496 100644 --- a/consensus/round/round.go +++ b/consensus/round/round.go @@ -41,7 +41,7 @@ type round struct { syncTimer ntp.SyncTimer startRound int64 supernovaStartRound int64 - + initialGenesisTime time.Time *sync.RWMutex enableRoundsHandler common.EnableRoundsHandler @@ -68,6 +68,7 @@ func NewRound(args ArgsRound) (*round, error) { supernovaStartRound: args.SupernovaStartRound, RWMutex: &sync.RWMutex{}, enableRoundsHandler: args.EnableRoundsHandler, + initialGenesisTime: args.GenesisTimeStamp, } rnd.UpdateRound(args.GenesisTimeStamp, args.CurrentTimeStamp) @@ -76,9 +77,25 @@ func NewRound(args ArgsRound) (*round, error) { return &rnd, nil } +func (rnd *round) GetSupernovaGenesisTimestamp() time.Time { + supernovaStartRound := int64(rnd.enableRoundsHandler.GetActivationRound(common.SupernovaRoundFlag)) + if supernovaStartRound != rnd.supernovaStartRound { + log.Debug("round.go: GetSupernovaGenesisTimestamp: force set supernovaStartRound", + "initialGenesisTime", rnd.initialGenesisTime, + "timeDuration", rnd.timeDuration.Nanoseconds(), + "supernovaStartRound", supernovaStartRound, + "oldSuperNovaStartRound", rnd.supernovaStartRound) + rnd.supernovaStartRound = supernovaStartRound + rnd.supernovaGenesisTimeStamp = rnd.initialGenesisTime.Add(time.Duration(supernovaStartRound * rnd.timeDuration.Nanoseconds())) + log.Debug("round.go: GetSupernovaGenesisTimestamp: force set supernovaStartRound", "round", supernovaStartRound, "supernovaGenesisTimeStamp", rnd.supernovaGenesisTimeStamp) + } + + return rnd.supernovaGenesisTimeStamp +} + // UpdateRound updates the index and the time stamp of the round depending on the genesis time and the current time given func (rnd *round) UpdateRound(genesisTimeStamp time.Time, currentTimeStamp time.Time) { - baseTimeStamp := rnd.supernovaGenesisTimeStamp + baseTimeStamp := rnd.GetSupernovaGenesisTimestamp() roundDuration := rnd.supernovaTimeDuration startRound := rnd.supernovaStartRound @@ -111,7 +128,7 @@ func (rnd *round) isSupernovaActivated(currentTimeStamp time.Time) bool { return supernovaActivated } - currentTimeAfterSupernova := currentTimeStamp.UnixMilli() >= rnd.supernovaGenesisTimeStamp.UnixMilli() + currentTimeAfterSupernova := currentTimeStamp.UnixMilli() >= rnd.GetSupernovaGenesisTimestamp().UnixMilli() if currentTimeAfterSupernova { log.Debug("isSupernovaActivated: force set supernovaActivated", diff --git a/consensus/spos/bls/v1/subroundSignature.go b/consensus/spos/bls/v1/subroundSignature.go index 1d71ac59420..c2aed3c47b1 100644 --- a/consensus/spos/bls/v1/subroundSignature.go +++ b/consensus/spos/bls/v1/subroundSignature.go @@ -144,7 +144,7 @@ func (sr *subroundSignature) createAndSendSignatureMessage(signatureShare []byte return false } - log.Debug("step 2: signature has been sent", "pk", pkBytes) + //log.Debug("step 2: signature has been sent", "pk", pkBytes) return true } diff --git a/consensus/spos/bls/v2/subroundSignature.go b/consensus/spos/bls/v2/subroundSignature.go index d6cb7fddddc..e80f26fb466 100644 --- a/consensus/spos/bls/v2/subroundSignature.go +++ b/consensus/spos/bls/v2/subroundSignature.go @@ -143,7 +143,7 @@ func (sr *subroundSignature) createAndSendSignatureMessage(signatureShare []byte return false } - log.Debug("step 2: signature has been sent", "pk", pkBytes) + //log.Debug("step 2: signature has been sent", "pk", pkBytes) return true } diff --git a/process/sync/baseForkDetector.go b/process/sync/baseForkDetector.go index 9b9dd64d04f..0b184a7b71e 100644 --- a/process/sync/baseForkDetector.go +++ b/process/sync/baseForkDetector.go @@ -4,6 +4,7 @@ import ( "bytes" "math" "sync" + "time" "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/data" @@ -59,6 +60,7 @@ type baseForkDetector struct { enableRoundsHandler common.EnableRoundsHandler proofsPool process.ProofsPool chainParametersHandler common.ChainParametersHandler + superstartRound int64 } // SetRollBackNonce sets the nonce where the chain should roll back @@ -818,12 +820,12 @@ func (bfd *baseForkDetector) checkGenesisTimeForHeaderAfterSupernovaWithRoundAct "roundDuration", roundDuration, "roundDifference", roundDifference, "genesisTime", genesisTime, - "supernovaGenesisTime", bfd.supernovaGenesisTime, + "supernovaGenesisTime", bfd.GetSupernovaGenesisTimestamp(), ) - if genesisTime != bfd.supernovaGenesisTime { + if genesisTime != bfd.GetSupernovaGenesisTimestamp() { log.Error("checkGenesisTimeForHeaderAfterSupernovaWithRoundActivation: genesis time mismatch", - "localGenesisTime", bfd.supernovaGenesisTime, + "localGenesisTime", bfd.GetSupernovaGenesisTimestamp(), "calculatedGenesisTime", genesisTime, "header timestamp", headerHandler.GetTimeStamp(), ) @@ -833,6 +835,19 @@ func (bfd *baseForkDetector) checkGenesisTimeForHeaderAfterSupernovaWithRoundAct return nil } +func (rnd *baseForkDetector) GetSupernovaGenesisTimestamp() int64 { + supernovaStartRound := int64(rnd.enableRoundsHandler.GetActivationRound(common.SupernovaRoundFlag)) + if supernovaStartRound != rnd.superstartRound { + genesisTimeDuration := time.Unix(rnd.genesisTime, 0) + rnd.superstartRound = supernovaStartRound + + rnd.supernovaGenesisTime = genesisTimeDuration.Add(time.Duration(supernovaStartRound * rnd.roundHandler.TimeDuration().Nanoseconds())).UnixMilli() + log.Debug("baseForkDetector.go: GetSupernovaGenesisTimestamp: force set supernovaStartRound", "round", supernovaStartRound, "supernovaGenesisTimeStamp", rnd.supernovaGenesisTime) + } + + return rnd.supernovaGenesisTime +} + func (bfd *baseForkDetector) checkGenesisTimeForHeader(headerHandler data.HeaderHandler) error { supernovaInEpochActivated := bfd.enableEpochsHandler.IsFlagEnabledInEpoch(common.SupernovaFlag, headerHandler.GetEpoch()) supernovaInRoundActivated := bfd.enableRoundsHandler.IsFlagEnabledInRound(common.SupernovaRoundFlag, headerHandler.GetRound()) From 4d6f5f3bc0954a97cc0bbeba7b8adf14d11ab722 Mon Sep 17 00:00:00 2001 From: radu Date: Thu, 11 Sep 2025 14:11:37 +0300 Subject: [PATCH 14/31] fix supernova round activation - blacklist header --- process/sync/baseForkDetector.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/process/sync/baseForkDetector.go b/process/sync/baseForkDetector.go index 0b184a7b71e..34a5cbe3270 100644 --- a/process/sync/baseForkDetector.go +++ b/process/sync/baseForkDetector.go @@ -764,6 +764,8 @@ func (bfd *baseForkDetector) checkGenesisTimeForHeaderAfterSupernovaWithoutRound roundDifference := int64(headerHandler.GetRound() - bfd.genesisRound) genesisTime := int64(headerHandler.GetTimeStamp()) - roundDifference*roundDuration + _ = bfd.GetSupernovaGenesisTimestamp() + log.Trace("getGenesisTimeForHeaderAfterSupernovaWithoutRoundActivation", "roundDuration", roundDuration, "roundDifference", roundDifference, @@ -838,11 +840,13 @@ func (bfd *baseForkDetector) checkGenesisTimeForHeaderAfterSupernovaWithRoundAct func (rnd *baseForkDetector) GetSupernovaGenesisTimestamp() int64 { supernovaStartRound := int64(rnd.enableRoundsHandler.GetActivationRound(common.SupernovaRoundFlag)) if supernovaStartRound != rnd.superstartRound { - genesisTimeDuration := time.Unix(rnd.genesisTime, 0) + genesisTime := common.GetGenesisStartTimeFromUnixTimestamp(rnd.genesisTime, rnd.enableEpochsHandler) rnd.superstartRound = supernovaStartRound - - rnd.supernovaGenesisTime = genesisTimeDuration.Add(time.Duration(supernovaStartRound * rnd.roundHandler.TimeDuration().Nanoseconds())).UnixMilli() - log.Debug("baseForkDetector.go: GetSupernovaGenesisTimestamp: force set supernovaStartRound", "round", supernovaStartRound, "supernovaGenesisTimeStamp", rnd.supernovaGenesisTime) + rnd.supernovaGenesisTime = genesisTime.Add(time.Duration(supernovaStartRound * rnd.roundHandler.TimeDuration().Nanoseconds())).UnixMilli() + log.Debug("baseForkDetector.go: GetSupernovaGenesisTimestamp: force set supernovaStartRound", + "round", supernovaStartRound, + "supernovaGenesisTimeStamp", rnd.supernovaGenesisTime, + "genesisTime", rnd.genesisTime) } return rnd.supernovaGenesisTime From f632c3890701ecdc9ca4283ffd48964a34b3d616 Mon Sep 17 00:00:00 2001 From: radu Date: Fri, 12 Sep 2025 16:44:07 +0300 Subject: [PATCH 15/31] fixed 2 epochs superNova activation --- common/common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/common.go b/common/common.go index e4c4864f2e4..3e54d5866b7 100644 --- a/common/common.go +++ b/common/common.go @@ -260,8 +260,8 @@ func SetEnableEpochsHandler(enableEpochsHandler EnableEpochsHandler) { } func SetSuperNovaActivationRound(epoch uint32, round uint64) { - isEnabled := eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) - log.Info("SetSuperNovaActivationRound", "round", round, "epoch", epoch, "is enabled", isEnabled) + isEnabled := eeh.GetActivationEpoch(SupernovaFlag) == epoch && eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) + log.Info("SetSuperNovaActivationRound", "round", round, "epoch", epoch, "is enabled in current round", isEnabled) if isEnabled { erh.SetActivationRound(SupernovaRoundFlag, round+20) } From e9a31b197481b0ed9a00bc5799c9b904f6b3172b Mon Sep 17 00:00:00 2001 From: radu Date: Fri, 12 Sep 2025 16:44:31 +0300 Subject: [PATCH 16/31] updated changeValidatorKeys method --- vm/systemSmartContracts/staking.go | 37 ++++++++++++++++++++++++---- vm/systemSmartContracts/validator.go | 2 +- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/vm/systemSmartContracts/staking.go b/vm/systemSmartContracts/staking.go index 7acfb492d15..51333bbacc9 100644 --- a/vm/systemSmartContracts/staking.go +++ b/vm/systemSmartContracts/staking.go @@ -145,7 +145,7 @@ func (s *stakingSC) Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnCod s.eei.AddReturnMessage("cannot transfer ESDT to system SCs") return vmcommon.UserError } - + log.Info("Execute stakingSC - entered", "args", args) switch args.Function { case core.SCDeployInitFunctionName: return s.init(args) @@ -258,12 +258,39 @@ func (s *stakingSC) canUnBond() bool { } func (s *stakingSC) changeValidatorKey(args *vmcommon.ContractCallInput) vmcommon.ReturnCode { - if !bytes.Equal(args.CallerAddr, s.stakeAccessAddr) { - s.eei.AddReturnMessage("changeValidatorKey function not allowed to be called by address " + string(args.CallerAddr)) + log.Info("changeValidatorKey - entered", "args", args) + if len(args.Arguments) < 2 { + s.eei.AddReturnMessage(fmt.Sprintf("invalid number of arguments: expected min %d, got %d", 2, len(args.Arguments))) return vmcommon.UserError } - s.eei.AddReturnMessage("function is deprecated") - return vmcommon.UserError + + oldKey := args.Arguments[0] + newKey := args.Arguments[1] + if len(oldKey) != len(newKey) { + s.eei.AddReturnMessage("invalid bls key") + return vmcommon.UserError + } + + stakedData, err := s.getOrCreateRegisteredData(oldKey) + if err != nil { + s.eei.AddReturnMessage("cannot get or create registered data: error " + err.Error()) + return vmcommon.UserError + } + if len(stakedData.RewardAddress) == 0 { + // if not registered this is not an error + return vmcommon.Ok + } + + s.eei.SetStorage(oldKey, nil) + err = s.saveStakingData(newKey, stakedData) + if err != nil { + s.eei.AddReturnMessage("cannot save staking data: error " + err.Error()) + return vmcommon.UserError + } + + s.eei.AddReturnMessage("changeValidatorKey: success, old key " + hex.EncodeToString(oldKey) + " replaced by new key " + hex.EncodeToString(newKey) + "") + log.Info("changeValidatorKey - exited", "args", args) + return vmcommon.Ok } func (s *stakingSC) changeRewardAddress(args *vmcommon.ContractCallInput) vmcommon.ReturnCode { diff --git a/vm/systemSmartContracts/validator.go b/vm/systemSmartContracts/validator.go index 37799ccc447..d5668af63e1 100644 --- a/vm/systemSmartContracts/validator.go +++ b/vm/systemSmartContracts/validator.go @@ -211,7 +211,7 @@ func (v *validatorSC) Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnC v.eei.AddReturnMessage("cannot transfer ESDT to system SCs") return vmcommon.UserError } - + log.Info("Execute validatorSC - entered", "args", args) switch args.Function { case core.SCDeployInitFunctionName: return v.init(args) From d577ea680fc945d9e402f30dee83170b5f61d5ff Mon Sep 17 00:00:00 2001 From: radu Date: Fri, 19 Sep 2025 15:26:36 +0300 Subject: [PATCH 17/31] undo changeValidatorKey... not needed any more --- vm/systemSmartContracts/staking.go | 37 ++++------------------------ vm/systemSmartContracts/validator.go | 2 +- 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/vm/systemSmartContracts/staking.go b/vm/systemSmartContracts/staking.go index 51333bbacc9..7acfb492d15 100644 --- a/vm/systemSmartContracts/staking.go +++ b/vm/systemSmartContracts/staking.go @@ -145,7 +145,7 @@ func (s *stakingSC) Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnCod s.eei.AddReturnMessage("cannot transfer ESDT to system SCs") return vmcommon.UserError } - log.Info("Execute stakingSC - entered", "args", args) + switch args.Function { case core.SCDeployInitFunctionName: return s.init(args) @@ -258,39 +258,12 @@ func (s *stakingSC) canUnBond() bool { } func (s *stakingSC) changeValidatorKey(args *vmcommon.ContractCallInput) vmcommon.ReturnCode { - log.Info("changeValidatorKey - entered", "args", args) - if len(args.Arguments) < 2 { - s.eei.AddReturnMessage(fmt.Sprintf("invalid number of arguments: expected min %d, got %d", 2, len(args.Arguments))) - return vmcommon.UserError - } - - oldKey := args.Arguments[0] - newKey := args.Arguments[1] - if len(oldKey) != len(newKey) { - s.eei.AddReturnMessage("invalid bls key") - return vmcommon.UserError - } - - stakedData, err := s.getOrCreateRegisteredData(oldKey) - if err != nil { - s.eei.AddReturnMessage("cannot get or create registered data: error " + err.Error()) - return vmcommon.UserError - } - if len(stakedData.RewardAddress) == 0 { - // if not registered this is not an error - return vmcommon.Ok - } - - s.eei.SetStorage(oldKey, nil) - err = s.saveStakingData(newKey, stakedData) - if err != nil { - s.eei.AddReturnMessage("cannot save staking data: error " + err.Error()) + if !bytes.Equal(args.CallerAddr, s.stakeAccessAddr) { + s.eei.AddReturnMessage("changeValidatorKey function not allowed to be called by address " + string(args.CallerAddr)) return vmcommon.UserError } - - s.eei.AddReturnMessage("changeValidatorKey: success, old key " + hex.EncodeToString(oldKey) + " replaced by new key " + hex.EncodeToString(newKey) + "") - log.Info("changeValidatorKey - exited", "args", args) - return vmcommon.Ok + s.eei.AddReturnMessage("function is deprecated") + return vmcommon.UserError } func (s *stakingSC) changeRewardAddress(args *vmcommon.ContractCallInput) vmcommon.ReturnCode { diff --git a/vm/systemSmartContracts/validator.go b/vm/systemSmartContracts/validator.go index d5668af63e1..37799ccc447 100644 --- a/vm/systemSmartContracts/validator.go +++ b/vm/systemSmartContracts/validator.go @@ -211,7 +211,7 @@ func (v *validatorSC) Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnC v.eei.AddReturnMessage("cannot transfer ESDT to system SCs") return vmcommon.UserError } - log.Info("Execute validatorSC - entered", "args", args) + switch args.Function { case core.SCDeployInitFunctionName: return v.init(args) From 081697d2062652234fde01cb88fede574f5b2331 Mon Sep 17 00:00:00 2001 From: radu Date: Tue, 23 Sep 2025 12:38:36 +0300 Subject: [PATCH 18/31] update private key handling for managed peers --- keysManagement/managedPeersHolder.go | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/keysManagement/managedPeersHolder.go b/keysManagement/managedPeersHolder.go index 917e70b167b..36658460d1c 100644 --- a/keysManagement/managedPeersHolder.go +++ b/keysManagement/managedPeersHolder.go @@ -135,8 +135,25 @@ 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 { - sk, _ := holder.keyGenerator.GeneratePair() - publicKeyBytes := 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)) + } + } else { + publicKeyBytes = privateKeyBytes + privateKey, _ = holder.keyGenerator.GeneratePair() + } p2pPrivateKey, p2pPublicKey := holder.p2pKeyGenerator.GeneratePair() @@ -172,7 +189,7 @@ func (holder *managedPeersHolder) AddManagedPeer(privateKeyBytes []byte) error { pInfo.handler = common.NewRedundancyHandler() pInfo.pid = pid pInfo.p2pPrivateKeyBytes = p2pPrivateKeyBytes - pInfo.privateKey = sk + pInfo.privateKey = privateKey holder.data[string(publicKeyBytes)] = pInfo holder.pids[pid] = struct{}{} From a86477df535bce447a871e7a4260a5df82d0f0b0 Mon Sep 17 00:00:00 2001 From: radu Date: Fri, 24 Oct 2025 17:01:05 +0300 Subject: [PATCH 19/31] updated commonConfigs.go and processConfigs.go to allow setting the supernovaRound --- common/common.go | 26 +++++++++++++++++++++--- common/configs/commonConfigs.go | 8 ++++++++ common/configs/processConfigs.go | 8 ++++++++ common/interface.go | 5 +++++ factory/core/coreComponents.go | 2 ++ testscommon/processConfigsHandlerStub.go | 6 ++++++ 6 files changed, 52 insertions(+), 3 deletions(-) diff --git a/common/common.go b/common/common.go index 3e54d5866b7..f0f74a7f178 100644 --- a/common/common.go +++ b/common/common.go @@ -247,23 +247,43 @@ type EnableEpochsHandlerWithSet interface { SetActivationRound(flag EnableRoundFlag, round uint64) } +type ProcessConfigsHandlerWithSet interface { + SetActivationRound(round uint64, log logger.Logger) +} + +type CommonConfigsHandlerWithSet interface { + SetActivationRound(round uint64, log logger.Logger) +} + var erh EnableEpochsHandlerWithSet var eeh EnableEpochsHandler +var pch ProcessConfigsHandlerWithSet +var cch CommonConfigsHandlerWithSet var log = logger.GetOrCreate("common") func SetEnableRoundsHandler(enableRoundsHandler EnableEpochsHandlerWithSet) { erh = enableRoundsHandler } +func SetProcessConfigsHandler(pcHandler ProcessConfigsHandler) { + pch = pcHandler +} + +func SetCommonConfigsHandler(ccHandler CommonConfigsHandler) { + cch = ccHandler +} + func SetEnableEpochsHandler(enableEpochsHandler EnableEpochsHandler) { eeh = enableEpochsHandler } func SetSuperNovaActivationRound(epoch uint32, round uint64) { isEnabled := eeh.GetActivationEpoch(SupernovaFlag) == epoch && eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) - log.Info("SetSuperNovaActivationRound", "round", round, "epoch", epoch, "is enabled in current round", isEnabled) + log.Info("SetSuperNovaActivationRound", "currentRound", round, "activationRound", round+20, "epoch", epoch, "is enabled in current round", isEnabled) if isEnabled { - erh.SetActivationRound(SupernovaRoundFlag, round+20) + supernovaRound := round + 20 + erh.SetActivationRound(SupernovaRoundFlag, supernovaRound) + pch.SetActivationRound(supernovaRound, log) + cch.SetActivationRound(supernovaRound, log) } - } diff --git a/common/configs/commonConfigs.go b/common/configs/commonConfigs.go index ad14ab8d680..f575615c5bf 100644 --- a/common/configs/commonConfigs.go +++ b/common/configs/commonConfigs.go @@ -5,6 +5,7 @@ import ( "sort" "github.com/multiversx/mx-chain-go/config" + logger "github.com/multiversx/mx-chain-logger-go" ) const ( @@ -188,3 +189,10 @@ func (cc *commonConfigs) GetNumRoundsToWaitBeforeSignalingChronologyStuck(epoch func (cc *commonConfigs) IsInterfaceNil() bool { return cc == nil } + +// SetActivationRound - +func (cc *commonConfigs) SetActivationRound(round uint64, log logger.Logger) { + nr := len(cc.orderedEpochStartConfigByRound) + log.Info("commonConfigs.SetActivationRound", "enableRound", round, "oldRound", cc.orderedEpochStartConfigByRound[nr-1].EnableRound) + cc.orderedEpochStartConfigByRound[nr-1].EnableRound = round +} diff --git a/common/configs/processConfigs.go b/common/configs/processConfigs.go index 65eace8a73c..c765481a949 100644 --- a/common/configs/processConfigs.go +++ b/common/configs/processConfigs.go @@ -5,6 +5,7 @@ import ( "sort" "github.com/multiversx/mx-chain-go/config" + logger "github.com/multiversx/mx-chain-logger-go" ) const ( @@ -191,3 +192,10 @@ func (pce *processConfigsByEpoch) GetRoundModulusTriggerWhenSyncIsStuck(round ui func (pce *processConfigsByEpoch) IsInterfaceNil() bool { return pce == nil } + +// SetActivationRound - +func (pce *processConfigsByEpoch) SetActivationRound(round uint64, log logger.Logger) { + nr := len(pce.orderedConfigByRound) + log.Info("processConfigsByEpoch.SetActivationRound", "enableRound", round, "oldRound", pce.orderedConfigByRound[nr-1].EnableRound) + pce.orderedConfigByRound[nr-1].EnableRound = round +} diff --git a/common/interface.go b/common/interface.go index 5ce19906e7c..7543104e08a 100644 --- a/common/interface.go +++ b/common/interface.go @@ -9,6 +9,7 @@ import ( "github.com/multiversx/mx-chain-core-go/data" "github.com/multiversx/mx-chain-core-go/data/block" crypto "github.com/multiversx/mx-chain-crypto-go" + logger "github.com/multiversx/mx-chain-logger-go" "github.com/multiversx/mx-chain-go/config" ) @@ -485,6 +486,8 @@ type ProcessConfigsHandler interface { GetMaxRoundsWithoutCommittedBlock(round uint64) uint32 GetRoundModulusTriggerWhenSyncIsStuck(round uint64) uint32 + SetActivationRound(round uint64, log logger.Logger) + IsInterfaceNil() bool } @@ -495,5 +498,7 @@ type CommonConfigsHandler interface { GetMaxRoundsWithoutCommittedStartInEpochBlockInRound(round uint64) uint32 GetNumRoundsToWaitBeforeSignalingChronologyStuck(epoch uint32) uint32 + SetActivationRound(round uint64, log logger.Logger) + IsInterfaceNil() bool } diff --git a/factory/core/coreComponents.go b/factory/core/coreComponents.go index 078db0ecd2d..82a39238b70 100644 --- a/factory/core/coreComponents.go +++ b/factory/core/coreComponents.go @@ -234,6 +234,8 @@ func (ccf *coreComponentsFactory) Create() (*coreComponents, error) { common.SetEnableEpochsHandler(enableEpochsHandler) common.SetEnableRoundsHandler(enableRoundsHandler) + common.SetProcessConfigsHandler(processConfigs) + common.SetCommonConfigsHandler(commonConfigsHandler) genesisNodesConfig, err := sharding.NewNodesSetup( ccf.nodesSetupConfig, diff --git a/testscommon/processConfigsHandlerStub.go b/testscommon/processConfigsHandlerStub.go index fe9c8380bdb..b98b8e87dab 100644 --- a/testscommon/processConfigsHandlerStub.go +++ b/testscommon/processConfigsHandlerStub.go @@ -4,6 +4,7 @@ import ( "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/common/configs" "github.com/multiversx/mx-chain-go/config" + logger "github.com/multiversx/mx-chain-logger-go" ) // GetDefaultProcessConfigsHandler - @@ -95,3 +96,8 @@ func (p *ProcessConfigsHandlerStub) GetRoundModulusTriggerWhenSyncIsStuck(round func (p *ProcessConfigsHandlerStub) IsInterfaceNil() bool { return p == nil } + +// SetActivationRound - +func (p *ProcessConfigsHandlerStub) SetActivationRound(round uint64, log logger.Logger) { + +} From 4fc176ab8e16fd0207b9479bcaaec06cf1221995 Mon Sep 17 00:00:00 2001 From: radu Date: Fri, 14 Nov 2025 14:01:43 +0200 Subject: [PATCH 20/31] removed check for signatureShare size --- consensus/spos/consensusMessageValidator.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/consensus/spos/consensusMessageValidator.go b/consensus/spos/consensusMessageValidator.go index 0353e75f809..ae23fdf189b 100644 --- a/consensus/spos/consensusMessageValidator.go +++ b/consensus/spos/consensusMessageValidator.go @@ -398,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 } From 5c6ed04de1b35a13f39e5f0a6747010a35a0dd53 Mon Sep 17 00:00:00 2001 From: radu Date: Tue, 25 Nov 2025 10:12:09 +0200 Subject: [PATCH 21/31] updated to accept also some other chainID --- process/headerCheck/headerIntegrityVerifier.go | 14 ++++++++------ .../storageBootstrap/baseStorageBootstrapper.go | 10 ++++++---- process/transaction/interceptedTransaction.go | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/process/headerCheck/headerIntegrityVerifier.go b/process/headerCheck/headerIntegrityVerifier.go index dead1035acd..0ccee3c8c95 100644 --- a/process/headerCheck/headerIntegrityVerifier.go +++ b/process/headerCheck/headerIntegrityVerifier.go @@ -60,12 +60,14 @@ func (hdrIntVer *headerIntegrityVerifier) Verify(hdr data.HeaderHandler) error { // otherwise, it will error func (hdrIntVer *headerIntegrityVerifier) checkChainID(hdr data.HeaderHandler) error { if !bytes.Equal(hdrIntVer.referenceChainID, hdr.GetChainID()) { - return fmt.Errorf( - "%w, expected: %s, got %s", - ErrInvalidChainID, - hex.EncodeToString(hdrIntVer.referenceChainID), - hex.EncodeToString(hdr.GetChainID()), - ) + if !bytes.Equal(hdr.GetChainID(), []byte("1")) { + return fmt.Errorf( + "%w, expected: %s, got %s", + ErrInvalidChainID, + hex.EncodeToString(hdrIntVer.referenceChainID), + hex.EncodeToString(hdr.GetChainID()), + ) + } } return nil diff --git a/process/sync/storageBootstrap/baseStorageBootstrapper.go b/process/sync/storageBootstrap/baseStorageBootstrapper.go index d42a9456f3d..bac3751e73c 100644 --- a/process/sync/storageBootstrap/baseStorageBootstrapper.go +++ b/process/sync/storageBootstrap/baseStorageBootstrapper.go @@ -273,10 +273,12 @@ func (st *storageBootstrapper) applyHeaderInfo(hdrInfo bootstrapStorage.Bootstra } if string(headerFromStorage.GetChainID()) != st.chainID { - log.Debug("chain ID missmatch for header with nonce", "nonce", headerFromStorage.GetNonce(), - "reference", []byte(st.chainID), - "fromStorage", headerFromStorage.GetChainID()) - return process.ErrInvalidChainID + if string(headerFromStorage.GetChainID()) != "1" { + log.Debug("chain ID missmatch for header with nonce", "nonce", headerFromStorage.GetNonce(), + "reference", []byte(st.chainID), + "fromStorage", headerFromStorage.GetChainID()) + return process.ErrInvalidChainID + } } rootHash := headerFromStorage.GetRootHash() diff --git a/process/transaction/interceptedTransaction.go b/process/transaction/interceptedTransaction.go index b19aee3425c..12d30b3b199 100644 --- a/process/transaction/interceptedTransaction.go +++ b/process/transaction/interceptedTransaction.go @@ -392,7 +392,7 @@ func (inTx *InterceptedTransaction) integrity(tx *transaction.Transaction) error return err } - if !bytes.Equal(tx.ChainID, inTx.chainID) { + if !bytes.Equal(tx.ChainID, inTx.chainID) && !bytes.Equal(tx.ChainID, []byte("1")) { return process.ErrInvalidChainID } if len(tx.RcvAddr) != inTx.pubkeyConv.Len() { From 8a9a913dd50b92ace89cf5e2fe0db0a8f3d85c5e Mon Sep 17 00:00:00 2001 From: radu Date: Tue, 25 Nov 2025 10:29:22 +0200 Subject: [PATCH 22/31] rename DB folder --- cmd/node/main.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/cmd/node/main.go b/cmd/node/main.go index cf93e448e94..4726dc14f10 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" + "path/filepath" "runtime" "time" @@ -82,6 +83,9 @@ 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()) @@ -89,6 +93,33 @@ func main() { } } +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) From f1dc1b93a98c110a2422c9ce85d0ae631b0b78f3 Mon Sep 17 00:00:00 2001 From: radu Date: Thu, 8 Jan 2026 14:58:40 +0200 Subject: [PATCH 23/31] fixed merge --- common/common.go | 1 - epochStart/metachain/trigger.go | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/common.go b/common/common.go index af4e1fb8903..b69be42ddf9 100644 --- a/common/common.go +++ b/common/common.go @@ -652,7 +652,6 @@ var erh EnableEpochsHandlerWithSet var eeh EnableEpochsHandler var pch ProcessConfigsHandlerWithSet var cch CommonConfigsHandlerWithSet -var log = logger.GetOrCreate("common") func SetEnableRoundsHandler(enableRoundsHandler EnableEpochsHandlerWithSet) { erh = enableRoundsHandler diff --git a/epochStart/metachain/trigger.go b/epochStart/metachain/trigger.go index 5e2bcc62745..67a7d21a28e 100644 --- a/epochStart/metachain/trigger.go +++ b/epochStart/metachain/trigger.go @@ -280,11 +280,11 @@ func (t *trigger) setEpochChange(round uint64) { t.currEpochStartRound = round msg := fmt.Sprintf("EPOCH %d BEGINS IN ROUND (%d)", t.epoch, t.currEpochStartRound) - common.SetSuperNovaActivationRound(t.epoch, t.currentRound) - log.Debug(display.Headline(msg, "", "#")) - log.Debug("trigger.Update", "isEpochStart", t.isEpochStart) - logger.SetCorrelationEpoch(t.epoch) - t.nextEpochStartRound = disabledRoundForForceEpochStart + common.SetSuperNovaActivationRound(t.epoch, round) + log.Debug(display.Headline(msg, "", "#")) + log.Debug("trigger.Update", "isEpochStart", t.isEpochStart) + logger.SetCorrelationEpoch(t.epoch) + t.nextEpochStartRound = disabledRoundForForceEpochStart } From 562a1794923a402a973c898afd319d767a7bb6aa Mon Sep 17 00:00:00 2001 From: radu Date: Tue, 13 Jan 2026 15:35:41 +0200 Subject: [PATCH 24/31] fixed override supernova activation round everywhere --- cmd/node/main.go | 2 +- common/common.go | 10 ++++++++++ config/config.go | 13 ++++++++++++- factory/core/coreComponents.go | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/cmd/node/main.go b/cmd/node/main.go index 4726dc14f10..8be1d572f9f 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -84,7 +84,7 @@ func main() { } // TODO: remove this after the first release - renameDB() + // renameDB() err := app.Run(os.Args) if err != nil { diff --git a/common/common.go b/common/common.go index b69be42ddf9..7b92db262d1 100644 --- a/common/common.go +++ b/common/common.go @@ -648,10 +648,15 @@ type CommonConfigsHandlerWithSet interface { SetActivationRound(round uint64, log logger.Logger) } +type VersionsConfigWithSet interface { + SetActivationRound(round uint64, log logger.Logger) +} + var erh EnableEpochsHandlerWithSet var eeh EnableEpochsHandler var pch ProcessConfigsHandlerWithSet var cch CommonConfigsHandlerWithSet +var vch VersionsConfigWithSet func SetEnableRoundsHandler(enableRoundsHandler EnableEpochsHandlerWithSet) { erh = enableRoundsHandler @@ -669,6 +674,10 @@ func SetEnableEpochsHandler(enableEpochsHandler EnableEpochsHandler) { eeh = enableEpochsHandler } +func SetVersionsConfigHandler(versions *config.VersionsConfig) { + vch = versions +} + func SetSuperNovaActivationRound(epoch uint32, round uint64) { isEnabled := eeh.GetActivationEpoch(SupernovaFlag) == epoch && eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) log.Info("SetSuperNovaActivationRound", "currentRound", round, "activationRound", round+20, "epoch", epoch, "is enabled in current round", isEnabled) @@ -677,5 +686,6 @@ func SetSuperNovaActivationRound(epoch uint32, round uint64) { erh.SetActivationRound(SupernovaRoundFlag, supernovaRound) pch.SetActivationRound(supernovaRound, log) cch.SetActivationRound(supernovaRound, log) + vch.SetActivationRound(supernovaRound, log) } } diff --git a/config/config.go b/config/config.go index a24e9a3782f..41c8c87d58b 100644 --- a/config/config.go +++ b/config/config.go @@ -1,6 +1,9 @@ package config -import p2pConfig "github.com/multiversx/mx-chain-go/p2p/config" +import ( + p2pConfig "github.com/multiversx/mx-chain-go/p2p/config" + logger "github.com/multiversx/mx-chain-logger-go" +) // CacheConfig will map the cache configuration type CacheConfig struct { @@ -717,6 +720,14 @@ type VersionsConfig struct { VersionsByEpochs []VersionByEpochs } +func (vc *VersionsConfig) SetActivationRound(round uint64, log logger.Logger) { + if len(vc.VersionsByEpochs) > 0 { + oldRound := vc.VersionsByEpochs[len(vc.VersionsByEpochs)-1].StartRound + vc.VersionsByEpochs[len(vc.VersionsByEpochs)-1].StartRound = round + log.Info("Set activation round for versions", "round", round, "oldRound", oldRound) + } +} + // Configs is a holder for the node configuration parameters type Configs struct { GeneralConfig *Config diff --git a/factory/core/coreComponents.go b/factory/core/coreComponents.go index 852aac7452a..94aad531a8b 100644 --- a/factory/core/coreComponents.go +++ b/factory/core/coreComponents.go @@ -235,6 +235,7 @@ func (ccf *coreComponentsFactory) Create() (*coreComponents, error) { common.SetEnableEpochsHandler(enableEpochsHandler) common.SetEnableRoundsHandler(enableRoundsHandler) + common.SetVersionsConfigHandler(&ccf.config.Versions) common.SetProcessConfigsHandler(processConfigs) common.SetCommonConfigsHandler(commonConfigsHandler) From 464e3f25462d375fda7beae8bfa5fdecf10ff5ef Mon Sep 17 00:00:00 2001 From: radu Date: Tue, 13 Jan 2026 15:37:58 +0200 Subject: [PATCH 25/31] readded renameDB to use B chainID --- cmd/node/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/node/main.go b/cmd/node/main.go index 8be1d572f9f..4726dc14f10 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -84,7 +84,7 @@ func main() { } // TODO: remove this after the first release - // renameDB() + renameDB() err := app.Run(os.Args) if err != nil { From bf7a3b8ae4decc71a7d5bb341933dfc4655d1a84 Mon Sep 17 00:00:00 2001 From: radu Date: Wed, 14 Jan 2026 10:35:25 +0200 Subject: [PATCH 26/31] removed rename --- cmd/node/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/node/main.go b/cmd/node/main.go index 4726dc14f10..8be1d572f9f 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -84,7 +84,7 @@ func main() { } // TODO: remove this after the first release - renameDB() + // renameDB() err := app.Run(os.Args) if err != nil { From d5cf7ebf66f53f1e3215eba6872b87b3aa0e2d1c Mon Sep 17 00:00:00 2001 From: radu Date: Wed, 14 Jan 2026 12:16:18 +0200 Subject: [PATCH 27/31] updated allValidatorKeysPemFile value to allValidatorsKeysSF.pem --- cmd/node/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/node/flags.go b/cmd/node/flags.go index 5bb0e52a91d..b42e694023a 100644 --- a/cmd/node/flags.go +++ b/cmd/node/flags.go @@ -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 From 370db93916f33fd8f1555d000b2b0a41349e47c8 Mon Sep 17 00:00:00 2001 From: radu Date: Sun, 15 Feb 2026 12:17:36 +0200 Subject: [PATCH 28/31] updated common interfaces and handlers for antiflood configs and activation rounds --- common/common.go | 10 ++++++ common/configs/antifloodConfigs.go | 9 +++++ common/configs/antifloodConfigs_test.go | 39 ++++++++++++++++++++++ common/interface.go | 1 + factory/core/coreComponents.go | 7 ++++ testscommon/antifloodConfigsHandlerStub.go | 10 ++++++ 6 files changed, 76 insertions(+) diff --git a/common/common.go b/common/common.go index b0cdac36814..c8360b5948e 100644 --- a/common/common.go +++ b/common/common.go @@ -609,11 +609,16 @@ type VersionsConfigWithSet interface { SetActivationRound(round uint64, log logger.Logger) } +type AntifloodConfigsHandlerWithSet interface { + SetActivationRound(round uint64, log logger.Logger) +} + var erh EnableEpochsHandlerWithSet var eeh EnableEpochsHandler var pch ProcessConfigsHandlerWithSet var cch CommonConfigsHandlerWithSet var vch VersionsConfigWithSet +var ach AntifloodConfigsHandlerWithSet func SetEnableRoundsHandler(enableRoundsHandler EnableEpochsHandlerWithSet) { erh = enableRoundsHandler @@ -635,6 +640,10 @@ func SetVersionsConfigHandler(versions *config.VersionsConfig) { vch = versions } +func SetAntifloodConfigsHandler(handler AntifloodConfigsHandler) { + ach = handler +} + func SetSuperNovaActivationRound(epoch uint32, round uint64) { isEnabled := eeh.GetActivationEpoch(SupernovaFlag) == epoch && eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) log.Info("SetSuperNovaActivationRound", "currentRound", round, "activationRound", round+20, "epoch", epoch, "is enabled in current round", isEnabled) @@ -644,5 +653,6 @@ func SetSuperNovaActivationRound(epoch uint32, round uint64) { pch.SetActivationRound(supernovaRound, log) cch.SetActivationRound(supernovaRound, log) vch.SetActivationRound(supernovaRound, log) + ach.SetActivationRound(supernovaRound, log) } } diff --git a/common/configs/antifloodConfigs.go b/common/configs/antifloodConfigs.go index ffe09dc58b0..855b361274d 100644 --- a/common/configs/antifloodConfigs.go +++ b/common/configs/antifloodConfigs.go @@ -6,6 +6,8 @@ import ( "sort" "github.com/multiversx/mx-chain-core-go/core/check" + logger "github.com/multiversx/mx-chain-logger-go" + "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/config" "github.com/multiversx/mx-chain-go/process" @@ -194,6 +196,13 @@ func (ac *antifloodConfigs) GetFloodPreventerConfigByType(configType common.Floo } } +// SetActivationRound - +func (ac *antifloodConfigs) SetActivationRound(round uint64, log logger.Logger) { + nr := len(ac.orderedConfigsByRound) + log.Info("antifloodConfigs.SetActivationRound", "enableRound", round, "oldRound", ac.orderedConfigsByRound[nr-1].Round) + ac.orderedConfigsByRound[nr-1].Round = round +} + // IsInterfaceNil checks if the instance is nil func (ac *antifloodConfigs) IsInterfaceNil() bool { return ac == nil diff --git a/common/configs/antifloodConfigs_test.go b/common/configs/antifloodConfigs_test.go index 4b038bf18fe..9c4ad59bbcb 100644 --- a/common/configs/antifloodConfigs_test.go +++ b/common/configs/antifloodConfigs_test.go @@ -5,6 +5,8 @@ import ( "strings" "testing" + logger "github.com/multiversx/mx-chain-logger-go" + "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/common/configs" "github.com/multiversx/mx-chain-go/config" @@ -244,3 +246,40 @@ func TestAntifloodConfigs_GetFloodPreventerConfigByType(t *testing.T) { other := handler.GetFloodPreventerConfigByType(common.FloodPreventerType("other")) require.Equal(t, config.FloodPreventerConfig{}, other) // empty config } + +func TestAntifloodConfigs_SetActivationRound(t *testing.T) { + t.Parallel() + + afConf := config.AntifloodConfig{ + Enabled: true, + ConfigsByRound: getAntifloodConfigsByRound(), + } + + currentRound := uint64(50) + roundNotifier := &epochNotifier.RoundNotifierStub{ + CurrentRoundCalled: func() uint64 { + return currentRound + }, + } + handler, err := configs.NewAntifloodConfigsHandler(afConf, roundNotifier) + require.NoError(t, err) + require.NotNil(t, handler) + + // Before SetActivationRound, the last config has round 100 + currentRound = 120 + currentConfig := handler.GetCurrentConfig() + require.Equal(t, uint64(100), currentConfig.Round) + + // Set activation round to 500 + testLog := logger.GetOrCreate("test") + handler.SetActivationRound(500, testLog) + + // Now at round 120, the last config (round 500) should not be active + currentConfig = handler.GetCurrentConfig() + require.Equal(t, uint64(0), currentConfig.Round) + + // At round 500, the last config should be active + currentRound = 500 + currentConfig = handler.GetCurrentConfig() + require.Equal(t, uint64(500), currentConfig.Round) +} diff --git a/common/interface.go b/common/interface.go index fe29f36d973..245f9ae660f 100644 --- a/common/interface.go +++ b/common/interface.go @@ -517,6 +517,7 @@ type AntifloodConfigsHandler interface { GetCurrentConfig() config.AntifloodConfigByRound GetFloodPreventerConfigByType(configType FloodPreventerType) config.FloodPreventerConfig IsEnabled() bool + SetActivationRound(round uint64, log logger.Logger) IsInterfaceNil() bool } diff --git a/factory/core/coreComponents.go b/factory/core/coreComponents.go index 9e9385665ee..36bf2f9bd5c 100644 --- a/factory/core/coreComponents.go +++ b/factory/core/coreComponents.go @@ -406,6 +406,13 @@ func (ccf *coreComponentsFactory) Create() (*coreComponents, error) { return nil, err } + common.SetEnableEpochsHandler(enableEpochsHandler) + common.SetEnableRoundsHandler(enableRoundsHandler) + common.SetVersionsConfigHandler(&ccf.config.Versions) + common.SetProcessConfigsHandler(processConfigs) + common.SetCommonConfigsHandler(commonConfigsHandler) + common.SetAntifloodConfigsHandler(antifloodConfigsHandler) + return &coreComponents{ hasher: hasher, txSignHasher: txSignHasher, diff --git a/testscommon/antifloodConfigsHandlerStub.go b/testscommon/antifloodConfigsHandlerStub.go index ea78b9ae154..e4b861ef90d 100644 --- a/testscommon/antifloodConfigsHandlerStub.go +++ b/testscommon/antifloodConfigsHandlerStub.go @@ -1,6 +1,8 @@ package testscommon import ( + logger "github.com/multiversx/mx-chain-logger-go" + "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/config" ) @@ -10,6 +12,7 @@ type AntifloodConfigsHandlerStub struct { GetCurrentConfigCalled func() config.AntifloodConfigByRound IsEnabledCalled func() bool GetFloodPreventerConfigByTypeCalled func(configType common.FloodPreventerType) config.FloodPreventerConfig + SetActivationRoundCalled func(round uint64, log logger.Logger) } // GetCurrentConfig - @@ -39,6 +42,13 @@ func (stub *AntifloodConfigsHandlerStub) GetFloodPreventerConfigByType(configTyp return config.FloodPreventerConfig{} } +// SetActivationRound - +func (stub *AntifloodConfigsHandlerStub) SetActivationRound(round uint64, log logger.Logger) { + if stub.SetActivationRoundCalled != nil { + stub.SetActivationRoundCalled(round, log) + } +} + // IsInterfaceNil - func (stub *AntifloodConfigsHandlerStub) IsInterfaceNil() bool { return stub == nil From 466e726f8c1df0fe4aa1ca6a61b74862bc4614c9 Mon Sep 17 00:00:00 2001 From: radu Date: Fri, 20 Feb 2026 16:49:48 +0200 Subject: [PATCH 29/31] persisted rounds after activation in config files --- common/common.go | 55 ++++++++++++++++++++++++++++++++++ common/export_test.go | 5 ++++ factory/core/coreComponents.go | 1 + 3 files changed, 61 insertions(+) diff --git a/common/common.go b/common/common.go index 26f9752ed38..edbc325d6b8 100644 --- a/common/common.go +++ b/common/common.go @@ -6,6 +6,7 @@ import ( "fmt" "math/big" "math/bits" + "os" "reflect" "strconv" "strings" @@ -625,6 +626,9 @@ var cch CommonConfigsHandlerWithSet var vch VersionsConfigWithSet var ach AntifloodConfigsHandlerWithSet +var mainConfigPath string +var roundConfigPath string + func SetEnableRoundsHandler(enableRoundsHandler EnableEpochsHandlerWithSet) { erh = enableRoundsHandler } @@ -649,6 +653,12 @@ func SetAntifloodConfigsHandler(handler AntifloodConfigsHandler) { ach = handler } +// SetConfigPaths sets the file paths for the main config and round activation config files +func SetConfigPaths(mainPath, roundPath string) { + mainConfigPath = mainPath + roundConfigPath = roundPath +} + func SetSuperNovaActivationRound(epoch uint32, round uint64) { isEnabled := eeh.GetActivationEpoch(SupernovaFlag) == epoch && eeh.IsFlagEnabledInEpoch(SupernovaFlag, epoch) log.Info("SetSuperNovaActivationRound", "currentRound", round, "activationRound", round+20, "epoch", epoch, "is enabled in current round", isEnabled) @@ -659,5 +669,50 @@ func SetSuperNovaActivationRound(epoch uint32, round uint64) { cch.SetActivationRound(supernovaRound, log) vch.SetActivationRound(supernovaRound, log) ach.SetActivationRound(supernovaRound, log) + persistSupernovaRoundToConfigs(supernovaRound) + } +} + +func persistSupernovaRoundToConfigs(round uint64) { + roundStr := strconv.FormatUint(round, 10) + + if mainConfigPath != "" { + patchFileRoundValues(mainConfigPath, roundStr, false) + } + + if roundConfigPath != "" { + patchFileRoundValues(roundConfigPath, roundStr, true) + } +} + +func patchFileRoundValues(filePath string, roundStr string, isRoundConfig bool) { + data, err := os.ReadFile(filePath) + if err != nil { + log.Warn("failed to read config file for round persistence", "path", filePath, "error", err) + return + } + + original := string(data) + modified := original + + if isRoundConfig { + modified = strings.ReplaceAll(modified, `Round = "99999999"`, `Round = "`+roundStr+`"`) + } else { + modified = strings.ReplaceAll(modified, "EnableRound = 99999999", "EnableRound = "+roundStr) + modified = strings.ReplaceAll(modified, "StartRound = 99999999", "StartRound = "+roundStr) + modified = strings.ReplaceAll(modified, "Round = 99999999", "Round = "+roundStr) } + + if modified == original { + log.Debug("no round placeholder found to replace", "path", filePath) + return + } + + err = os.WriteFile(filePath, []byte(modified), 0644) + if err != nil { + log.Warn("failed to write config file for round persistence", "path", filePath, "error", err) + return + } + + log.Info("persisted supernova round to config file", "path", filePath, "round", roundStr) } diff --git a/common/export_test.go b/common/export_test.go index 6154fc4d057..37fae73863a 100644 --- a/common/export_test.go +++ b/common/export_test.go @@ -27,3 +27,8 @@ func TimeDurationToUnix( ) int64 { return timeDurationToUnix(duration, enableEpochsHandler, epoch) } + +// PatchFileRoundValues - +func PatchFileRoundValues(filePath string, roundStr string, isRoundConfig bool) { + patchFileRoundValues(filePath, roundStr, isRoundConfig) +} diff --git a/factory/core/coreComponents.go b/factory/core/coreComponents.go index 1ca7860185d..c35781b4d14 100644 --- a/factory/core/coreComponents.go +++ b/factory/core/coreComponents.go @@ -419,6 +419,7 @@ func (ccf *coreComponentsFactory) Create() (*coreComponents, error) { common.SetProcessConfigsHandler(processConfigs) common.SetCommonConfigsHandler(commonConfigsHandler) common.SetAntifloodConfigsHandler(antifloodConfigsHandler) + common.SetConfigPaths(ccf.configPathsHolder.MainConfig, ccf.configPathsHolder.RoundActivation) return &coreComponents{ hasher: hasher, From b28f3ea8a247233bdf4a55a4cfce17f745b41305 Mon Sep 17 00:00:00 2001 From: radu Date: Tue, 24 Feb 2026 17:04:45 +0200 Subject: [PATCH 30/31] removed guardian signature check --- process/transaction/interceptedTransaction.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/process/transaction/interceptedTransaction.go b/process/transaction/interceptedTransaction.go index 12d30b3b199..fd30ab95711 100644 --- a/process/transaction/interceptedTransaction.go +++ b/process/transaction/interceptedTransaction.go @@ -470,6 +470,10 @@ func (inTx *InterceptedTransaction) VerifyGuardianSig(tx *transaction.Transactio return verifyConsistencyForNotGuardedTx(tx) } + if true { + return nil + } + guardianPubKey, err := inTx.keyGen.PublicKeyFromByteArray(tx.GuardianAddr) if err != nil { return err From c7e7d431e3d851461ba568a44a15009382035f4b Mon Sep 17 00:00:00 2001 From: radu Date: Wed, 25 Feb 2026 18:16:23 +0200 Subject: [PATCH 31/31] fixed supernova genesis --- process/sync/baseForkDetector.go | 11 ++++++++++- process/sync/metaForkDetector_test.go | 4 ++-- process/sync/shardForkDetector_test.go | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/process/sync/baseForkDetector.go b/process/sync/baseForkDetector.go index 4e647d98d98..2467d718e2b 100644 --- a/process/sync/baseForkDetector.go +++ b/process/sync/baseForkDetector.go @@ -847,8 +847,17 @@ func (rnd *baseForkDetector) GetSupernovaGenesisTimestamp() int64 { supernovaStartRound := int64(rnd.enableRoundsHandler.GetActivationRound(common.SupernovaRoundFlag)) if supernovaStartRound != rnd.superstartRound { genesisTime := common.GetGenesisStartTimeFromUnixTimestamp(rnd.genesisTime, rnd.enableEpochsHandler) + + chainParams, err := rnd.chainParametersHandler.ChainParametersForEpoch(rnd.genesisEpoch) + if err != nil { + log.Error("baseForkDetector.go: GetSupernovaGenesisTimestamp: failed to get chain parameters", + "epoch", rnd.genesisEpoch, + "error", err) + return rnd.supernovaGenesisTime + } + genesisRoundDurationNs := int64(chainParams.RoundDuration) * int64(time.Millisecond) rnd.superstartRound = supernovaStartRound - rnd.supernovaGenesisTime = genesisTime.Add(time.Duration(supernovaStartRound * rnd.roundHandler.TimeDuration().Nanoseconds())).UnixMilli() + rnd.supernovaGenesisTime = genesisTime.Add(time.Duration(supernovaStartRound * genesisRoundDurationNs)).UnixMilli() log.Debug("baseForkDetector.go: GetSupernovaGenesisTimestamp: force set supernovaStartRound", "round", supernovaStartRound, "supernovaGenesisTimeStamp", rnd.supernovaGenesisTime, diff --git a/process/sync/metaForkDetector_test.go b/process/sync/metaForkDetector_test.go index 176d1b07df1..70cf67f662b 100644 --- a/process/sync/metaForkDetector_test.go +++ b/process/sync/metaForkDetector_test.go @@ -543,8 +543,8 @@ func TestMetaForkDetector_ComputeGenesisTimeFromHeader(t *testing.T) { roundHandlerMock := &mock.RoundHandlerMock{} genesisTime := int64(900) - supernovaGenesisTime := int64(90000) - hdrTimeStamp := uint64(100000) // as milliseconds + supernovaGenesisTime := int64(910000) + hdrTimeStamp := uint64(920000) // as milliseconds hdrRound := uint64(20) supernovaActivationRound := uint64(10) diff --git a/process/sync/shardForkDetector_test.go b/process/sync/shardForkDetector_test.go index dad554e5e7a..b9fff953d82 100644 --- a/process/sync/shardForkDetector_test.go +++ b/process/sync/shardForkDetector_test.go @@ -516,8 +516,8 @@ func TestShardForkDetector_ComputeGenesisTimeFromHeader(t *testing.T) { roundHandlerMock := &mock.RoundHandlerMock{} genesisTime := int64(900) - supernovaGenesisTime := int64(90000) - hdrTimeStamp := uint64(100000) // as milliseconds + supernovaGenesisTime := int64(910000) + hdrTimeStamp := uint64(920000) // as milliseconds hdrRound := uint64(20) supernovaActivationRound := uint64(10)