Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
5631405
SF-v1.6.0 initial test
raduchis Sep 5, 2023
5ac599c
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Sep 6, 2023
91774dc
set singlesigner to disabled
raduchis Sep 7, 2023
075e960
do not check peerSignature
raduchis Sep 8, 2023
797b712
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Sep 8, 2023
19d6b88
added epochsFastForward
raduchis Sep 11, 2023
e6fb9d2
Merge remote-tracking branch 'origin/rc/v1.6.0' into SF-v1.6.0
raduchis Sep 18, 2023
8d41d1c
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Nov 10, 2023
4cd3a71
Merge branch 'rc/v1.6.0' into SF-v1.6.0
raduchis Nov 21, 2023
f1ac25d
Merge branch 'master' into SF-v1.6.0
raduchis Jan 15, 2024
475ee29
Merge remote-tracking branch 'origin/new-vm-common' into SF-v1.6.0
raduchis Jan 16, 2024
d8d459e
MaxTxNonceDeltaAllowed = 100000
raduchis Jan 17, 2024
67ad2eb
Merge remote-tracking branch 'origin/migrate-data-trie-fix' into SF-v…
raduchis Jan 25, 2024
72201bf
Merge remote-tracking branch 'origin/rc/v1.7.0' into SF-v1.7.0
raduchis Jan 30, 2024
140d553
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis Apr 12, 2024
79621d8
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis Apr 22, 2024
1f8a378
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis Apr 23, 2024
8cc7cf9
Merge branch 'rc/v1.7.0' into SF-v1.7.0
raduchis May 9, 2024
3dfbc41
Merge branch 'master' into SF-v1.7.0
raduchis May 21, 2024
1d40241
Merge branch 'master' into SF-v1.7.0
raduchis May 29, 2024
b2a3668
Merge branch 'master' into SF-1.7.0
raduchis Jul 2, 2024
24ceef3
Merge branch 'master' into SF-1.7.0
raduchis Aug 20, 2024
d205e62
Merge branch 'master' into SF-1.7.0
raduchis Nov 25, 2024
0585cba
Merge branch 'master' into SF-1.8.6
ssd04 Jan 10, 2025
8a94f2d
Merge branch 'master' into SF-1.8.11
ssd04 Feb 28, 2025
af69ba1
revert go mod
sasurobert May 14, 2025
d9f7ad4
revert go mod
sasurobert May 14, 2025
023df75
revert go mod
sasurobert May 14, 2025
ba34423
revert go mod
sasurobert May 14, 2025
16b5f83
Merge tag 'v1.8.13' into SF-1.8.13
raduchis May 15, 2025
7719e88
Merge branch 'SF-1.8.13' into SF-1.9.6
raduchis May 19, 2025
534fa5e
Merge branch 'refs/heads/rc/barnard' into SF-1.10.0
raduchis Jun 26, 2025
11e9ec4
Merge branch 'rc/barnard' into SF-1.10.0
raduchis Jul 9, 2025
6fc8110
Merge branch 'rc/barnard' into SF-1.10.0
raduchis Jul 10, 2025
2e3a611
Merge branch 'rc/barnard' into SF-1.10.0
raduchis Jul 16, 2025
2fc3cec
Merge remote-tracking branch 'origin/master' into SF-1.10.0
raduchis Aug 19, 2025
3476fbc
Merge remote-tracking branch 'origin/feat/sub-second-round' into SF-1…
raduchis Aug 19, 2025
f955601
sfEnableRoundsHandler.go
raduchis Aug 25, 2025
1782896
added epochRoundsHandler setActivationEpoch
raduchis Aug 25, 2025
7359940
more optimizations for setActivationRound
raduchis Aug 26, 2025
9ad0691
fix supernova round activation
raduchis Aug 28, 2025
4d6f5f3
fix supernova round activation - blacklist header
raduchis Sep 11, 2025
f632c38
fixed 2 epochs superNova activation
raduchis Sep 12, 2025
e9a31b1
updated changeValidatorKeys method
raduchis Sep 12, 2025
f02e54e
Merge branch 'feat/sub-second-round' into SF-1.11.0
raduchis Sep 17, 2025
d577ea6
undo changeValidatorKey... not needed any more
raduchis Sep 19, 2025
081697d
update private key handling for managed peers
raduchis Sep 23, 2025
a8c95e3
Merge remote-tracking branch 'origin/rc/supernova' into SF-1.11.0
raduchis Oct 23, 2025
721e7af
Merge branch 'rc/supernova' into SF-1.11.0
raduchis Oct 24, 2025
a86477d
updated commonConfigs.go and processConfigs.go to allow setting the s…
raduchis Oct 24, 2025
afb5a11
Merge branch 'rc/supernova' into SF-1.11.0
raduchis Oct 24, 2025
c8e1a72
Merge branch 'rc/supernova' into SF-1.11.0
raduchis Nov 14, 2025
4fc176a
removed check for signatureShare size
raduchis Nov 14, 2025
5c6ed04
updated to accept also some other chainID
raduchis Nov 25, 2025
8a9a913
rename DB folder
raduchis Nov 25, 2025
073d15f
Merge branch 'rc/supernova' into SF-1.11.0
raduchis Nov 26, 2025
d7155d4
Merge branch 'rc/supernova' into SF-1.12.0
raduchis Dec 15, 2025
00fd2c7
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 8, 2026
f1dc1b9
fixed merge
raduchis Jan 8, 2026
76770b2
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 9, 2026
ecde05f
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 13, 2026
562a179
fixed override supernova activation round everywhere
raduchis Jan 13, 2026
3f05592
Merge remote-tracking branch 'origin/SF-2.0' into SF-2.0
raduchis Jan 13, 2026
464e3f2
readded renameDB to use B chainID
raduchis Jan 13, 2026
bf7a3b8
removed rename
raduchis Jan 14, 2026
d5cf7eb
updated allValidatorKeysPemFile value to allValidatorsKeysSF.pem
raduchis Jan 14, 2026
2c2737a
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 14, 2026
6e812c6
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 14, 2026
a0bea1b
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 14, 2026
35398b7
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 22, 2026
9b0a815
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 26, 2026
820b0a0
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 26, 2026
db88111
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Jan 27, 2026
4ffb058
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Feb 4, 2026
40ecfa5
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Feb 6, 2026
4609914
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Feb 9, 2026
6cc07f0
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Feb 9, 2026
6538e20
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Feb 12, 2026
8177b3c
Merge branch 'feat/supernova-async-exec' into SF-2.0
raduchis Feb 13, 2026
370db93
updated common interfaces and handlers for antiflood configs and acti…
raduchis Feb 15, 2026
2b671c7
Merge remote-tracking branch 'origin/feat/supernova-async-exec' into …
raduchis Feb 20, 2026
466e726
persisted rounds after activation in config files
raduchis Feb 20, 2026
b28f3ea
removed guardian signature check
raduchis Feb 24, 2026
c7e7d43
fixed supernova genesis
raduchis Feb 25, 2026
51f6779
Merge remote-tracking branch 'origin/feat/supernova-async-exec' into …
raduchis Feb 27, 2026
ba21d4c
Merge branch 'SF-2.0' of github.com:/multiversx/mx-chain-go into SF-2.0
raduchis Feb 27, 2026
File filter

Filter by extension

Filter by extension

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

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

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

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

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

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

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

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

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

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

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

Expand Down
119 changes: 119 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math/big"
"math/bits"
"os"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -612,3 +613,121 @@ func GetFeePayer(tx data.TransactionHandler) []byte {

return tx.GetSndAddr()
}

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)
}

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

var mainConfigPath string
var roundConfigPath string

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 SetVersionsConfigHandler(versions *config.VersionsConfig) {
vch = versions
}

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)
if isEnabled {
supernovaRound := round + 20
erh.SetActivationRound(SupernovaRoundFlag, supernovaRound)
pch.SetActivationRound(supernovaRound, log)
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)
}
9 changes: 9 additions & 0 deletions common/configs/antifloodConfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
39 changes: 39 additions & 0 deletions common/configs/antifloodConfigs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
8 changes: 8 additions & 0 deletions common/configs/commonConfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"sort"

"github.com/multiversx/mx-chain-go/config"
logger "github.com/multiversx/mx-chain-logger-go"
)

const (
Expand Down Expand Up @@ -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
}
7 changes: 7 additions & 0 deletions common/configs/processConfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,10 @@ func (pce *processConfigsByEpoch) getValueByRound(
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
}
2 changes: 1 addition & 1 deletion common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const DisabledShardIDAsObserver = uint32(0xFFFFFFFF) - 7

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

// MaxBulkTransactionSize specifies the maximum size of one bulk with txs which can be send over the network
// TODO convert this const into a var and read it from config when this code moves to another binary
Expand Down
11 changes: 11 additions & 0 deletions common/enablers/enableRoundsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,14 @@ func (handler *enableRoundsHandler) GetAllEnableRounds() map[string]uint64 {
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)
}
5 changes: 5 additions & 0 deletions common/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 6 additions & 0 deletions common/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/common/configs/dto"
"github.com/multiversx/mx-chain-go/config"
Expand Down Expand Up @@ -498,6 +499,8 @@ type ProcessConfigsHandler interface {

GetValue(variable dto.ConfigVariable) uint64

SetActivationRound(round uint64, log logger.Logger)

IsInterfaceNil() bool
}

Expand All @@ -508,6 +511,8 @@ type CommonConfigsHandler interface {
GetMaxRoundsWithoutCommittedStartInEpochBlockInRound(round uint64) uint32
GetNumRoundsToWaitBeforeSignalingChronologyStuck(epoch uint32) uint32

SetActivationRound(round uint64, log logger.Logger)

IsInterfaceNil() bool
}

Expand All @@ -516,6 +521,7 @@ type AntifloodConfigsHandler interface {
GetCurrentConfig() config.AntifloodConfigByRound
GetFloodPreventerConfigByType(configType FloodPreventerType) config.FloodPreventerConfig
IsEnabled() bool
SetActivationRound(round uint64, log logger.Logger)
IsInterfaceNil() bool
}

Expand Down
13 changes: 12 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -743,6 +746,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
Expand Down
Loading
Loading