Skip to content

Commit 100dabb

Browse files
authored
Merge branch 'feat/supernova-async-exec' into backup-fixes
2 parents 0eede75 + 4754a77 commit 100dabb

File tree

11 files changed

+45
-5
lines changed

11 files changed

+45
-5
lines changed

.github/workflows/build_and_run_chain_simulator_and_execute_system_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ jobs:
437437
const exitCode = process.env.PYTEST_EXIT_CODE;
438438
439439
const simulatorCommitHash = process.env.SIMULATOR_COMMIT_HASH || 'N/A';
440+
const testingSuiteCommitHash = process.env.CURRENT_COMMIT_HASH || 'N/A';
440441
const r2Url = process.env.R2_REPORT_URL || 'N/A';
441442
442443
const issue_number = context.issue.number;
@@ -465,8 +466,9 @@ jobs:
465466
- **Current Branch:** \`${currentBranch}\`
466467
- **mx-chain-go Target Branch:** \`${goTargetBranch}\`
467468
- **mx-chain-simulator-go Target Branch:** \`${simulatorTargetBranch}\`
468-
- **mx-chain-testing-suite Target Branch:** \`${testingSuiteTargetBranch}\`
469469
- **mx-chain-simulator-go Commit Hash:** \`${simulatorCommitHash}\`
470+
- **mx-chain-testing-suite Target Branch:** \`${testingSuiteTargetBranch}\`
471+
- **mx-chain-testing-suite Commit Hash:** \`${testingSuiteCommitHash}\`
470472
471473
🚀 **Environment Variables:**
472474
- **TIMESTAMP:** \`${ts}\`

common/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,9 @@ const (
812812
// MetricRelayedTransactionsV1V2DisableEpoch represents the epoch when relayed transactions v1 and v2 are disabled
813813
MetricRelayedTransactionsV1V2DisableEpoch = "erd_relayed_transactions_v1_v2_disable_epoch"
814814

815+
// MetricTailInflationEnableEpoch represents the epoch when tail inflation is enabled
816+
MetricTailInflationEnableEpoch = "erd_tail_inflation_enable_epoch"
817+
815818
// MetricEpochEnable represents the epoch when the max nodes change configuration is applied
816819
MetricEpochEnable = "erd_epoch_enable"
817820

node/chainSimulator/chainSimulator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type transactionWithResult struct {
4646
// ArgsChainSimulator holds the arguments needed to create a new instance of simulator
4747
type ArgsChainSimulator struct {
4848
BypassTxSignatureCheck bool
49+
BypassBlockSignatureCheck bool
4950
TempDir string
5051
PathToInitialConfig string
5152
NumOfShards uint32
@@ -278,6 +279,7 @@ func (s *simulator) createTestNode(
278279
ShardIDStr: shardIDStr,
279280
APIInterface: args.ApiInterface,
280281
BypassTxSignatureCheck: args.BypassTxSignatureCheck,
282+
BypassBlockSignatureCheck: args.BypassBlockSignatureCheck,
281283
InitialRound: args.InitialRound,
282284
InitialNonce: args.InitialNonce,
283285
MinNodesPerShard: args.MinNodesPerShard,

node/chainSimulator/chainSimulator_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import (
1010
"github.com/multiversx/mx-chain-core-go/core"
1111
apiBlock "github.com/multiversx/mx-chain-core-go/data/api"
1212
"github.com/multiversx/mx-chain-core-go/data/transaction"
13-
"github.com/multiversx/mx-chain-go/common"
1413
"github.com/stretchr/testify/assert"
1514
"github.com/stretchr/testify/require"
1615

16+
"github.com/multiversx/mx-chain-go/common"
17+
1718
"github.com/multiversx/mx-chain-go/config"
1819
"github.com/multiversx/mx-chain-go/errors"
1920
chainSimulatorCommon "github.com/multiversx/mx-chain-go/integrationTests/chainSimulator"
@@ -138,6 +139,7 @@ func TestChainSimulator_GenerateBlocksShouldWork(t *testing.T) {
138139

139140
chainSimulator, err := NewChainSimulator(ArgsChainSimulator{
140141
BypassTxSignatureCheck: true,
142+
BypassBlockSignatureCheck: true,
141143
TempDir: t.TempDir(),
142144
PathToInitialConfig: defaultPathToInitialConfig,
143145
NumOfShards: defaultNumOfShards,

node/chainSimulator/components/cryptoComponents.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/multiversx/mx-chain-core-go/core"
88
crypto "github.com/multiversx/mx-chain-crypto-go"
99
"github.com/multiversx/mx-chain-crypto-go/signing/disabled/singlesig"
10+
1011
"github.com/multiversx/mx-chain-go/common"
1112
cryptoCommon "github.com/multiversx/mx-chain-go/common/crypto"
1213
"github.com/multiversx/mx-chain-go/config"
@@ -24,6 +25,7 @@ type ArgsCryptoComponentsHolder struct {
2425
CoreComponentsHolder factory.CoreComponentsHolder
2526
AllValidatorKeysPemFileName string
2627
BypassTxSignatureCheck bool
28+
BypassBlockSignatureCheck bool
2729
}
2830

2931
type cryptoComponentsHolder struct {
@@ -95,7 +97,11 @@ func CreateCryptoComponents(args ArgsCryptoComponentsHolder) (*cryptoComponentsH
9597
instance.p2pPublicKey = managedCryptoComponents.P2pPublicKey()
9698
instance.p2pPrivateKey = managedCryptoComponents.P2pPrivateKey()
9799
instance.p2pSingleSigner = managedCryptoComponents.P2pSingleSigner()
98-
instance.blockSigner = managedCryptoComponents.BlockSigner()
100+
if args.BypassBlockSignatureCheck {
101+
instance.blockSigner = &singlesig.DisabledSingleSig{}
102+
} else {
103+
instance.blockSigner = managedCryptoComponents.BlockSigner()
104+
}
99105

100106
instance.multiSignerContainer = managedCryptoComponents.MultiSignerContainer()
101107
instance.peerSignatureHandler = managedCryptoComponents.PeerSignatureHandler()

node/chainSimulator/components/cryptoComponents_test.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package components
22

33
import (
4+
"fmt"
45
"testing"
56

67
"github.com/multiversx/mx-chain-core-go/core"
8+
"github.com/stretchr/testify/require"
9+
710
"github.com/multiversx/mx-chain-go/config"
811
"github.com/multiversx/mx-chain-go/testscommon"
912
"github.com/multiversx/mx-chain-go/testscommon/factory"
10-
"github.com/stretchr/testify/require"
1113
)
1214

1315
func createArgsCryptoComponentsHolder() ArgsCryptoComponentsHolder {
@@ -48,6 +50,7 @@ func createArgsCryptoComponentsHolder() ArgsCryptoComponentsHolder {
4850
},
4951
AllValidatorKeysPemFileName: "allValidatorKeys.pem",
5052
BypassTxSignatureCheck: true,
53+
BypassBlockSignatureCheck: false,
5154
}
5255
}
5356

@@ -76,6 +79,19 @@ func TestCreateCryptoComponents(t *testing.T) {
7679
require.Nil(t, comp.Create())
7780
require.Nil(t, comp.Close())
7881
})
82+
t.Run("should work with bypass blocks sig check", func(t *testing.T) {
83+
t.Parallel()
84+
85+
args := createArgsCryptoComponentsHolder()
86+
args.BypassBlockSignatureCheck = true
87+
comp, err := CreateCryptoComponents(args)
88+
require.NoError(t, err)
89+
require.NotNil(t, comp)
90+
require.Equal(t, "*singlesig.DisabledSingleSig", fmt.Sprintf("%T", comp.blockSigner))
91+
92+
require.Nil(t, comp.Create())
93+
require.Nil(t, comp.Close())
94+
})
7995
t.Run("NewCryptoComponentsFactory failure should error", func(t *testing.T) {
8096
t.Parallel()
8197

node/chainSimulator/components/testOnlyProcessingNode.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type ArgsTestOnlyProcessingNode struct {
4949
NumShards uint32
5050
ShardIDStr string
5151
BypassTxSignatureCheck bool
52+
BypassBlockSignatureCheck bool
5253
MinNodesPerShard uint32
5354
ConsensusGroupSize uint32
5455
MinNodesMeta uint32
@@ -129,6 +130,7 @@ func NewTestOnlyProcessingNode(args ArgsTestOnlyProcessingNode) (*testOnlyProces
129130
Preferences: *args.Configs.PreferencesConfig,
130131
CoreComponentsHolder: instance.CoreComponentsHolder,
131132
BypassTxSignatureCheck: args.BypassTxSignatureCheck,
133+
BypassBlockSignatureCheck: args.BypassBlockSignatureCheck,
132134
AllValidatorKeysPemFileName: args.Configs.ConfigurationPathsHolder.AllValidatorKeys,
133135
})
134136
if err != nil {

node/metrics/metrics.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ func InitConfigMetrics(
212212
appStatusHandler.SetUInt64Value(common.MetricAutomaticActivationOfNodesDisableEpoch, uint64(enableEpochs.AutomaticActivationOfNodesDisableEpoch))
213213
appStatusHandler.SetUInt64Value(common.MetricFixGetBalanceEnableEpoch, uint64(enableEpochs.FixGetBalanceEnableEpoch))
214214
appStatusHandler.SetUInt64Value(common.MetricRelayedTransactionsV1V2DisableEpoch, uint64(enableEpochs.RelayedTransactionsV1V2DisableEpoch))
215+
appStatusHandler.SetUInt64Value(common.MetricTailInflationEnableEpoch, uint64(economicsConfig.GlobalSettings.TailInflation.EnableEpoch))
215216

216217
for i, nodesChangeConfig := range enableEpochs.MaxNodesChangeEnableEpoch {
217218
epochEnable := fmt.Sprintf("%s%d%s", common.MetricMaxNodesChangeEnableEpoch, i, common.EpochEnableSuffix)

node/metrics/metrics_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ func TestInitConfigMetrics(t *testing.T) {
353353
"erd_automatic_activation_of_nodes_disable_epoch": uint32(114),
354354
"erd_fix_get_balance_enable_epoch": uint32(115),
355355
"erd_relayed_transactions_v1_v2_disable_epoch": uint32(116),
356+
"erd_tail_inflation_enable_epoch": uint32(117),
356357
"erd_max_nodes_change_enable_epoch": nil,
357358
"erd_total_supply": "12345",
358359
"erd_hysteresis": "0.100000",
@@ -366,6 +367,9 @@ func TestInitConfigMetrics(t *testing.T) {
366367
economicsConfig := config.EconomicsConfig{
367368
GlobalSettings: config.GlobalSettings{
368369
GenesisTotalSupply: "12345",
370+
TailInflation: config.TailInflationSettings{
371+
EnableEpoch: 117,
372+
},
369373
},
370374
}
371375

statusHandler/statusMetricsProvider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ func (sm *statusMetrics) EnableEpochsMetrics() (map[string]interface{}, error) {
389389
enableEpochsMetrics[common.MetricBarnardOpcodesEnableEpoch] = sm.uint64Metrics[common.MetricBarnardOpcodesEnableEpoch]
390390
enableEpochsMetrics[common.MetricAutomaticActivationOfNodesDisableEpoch] = sm.uint64Metrics[common.MetricAutomaticActivationOfNodesDisableEpoch]
391391
enableEpochsMetrics[common.MetricFixGetBalanceEnableEpoch] = sm.uint64Metrics[common.MetricFixGetBalanceEnableEpoch]
392+
enableEpochsMetrics[common.MetricTailInflationEnableEpoch] = sm.uint64Metrics[common.MetricTailInflationEnableEpoch]
392393

393394
numNodesChangeConfig := sm.uint64Metrics[common.MetricMaxNodesChangeEnableEpoch+"_count"]
394395

0 commit comments

Comments
 (0)