Skip to content

Commit

Permalink
Merge pull request #6171 from multiversx/merge_rc17next1_into_feat/re…
Browse files Browse the repository at this point in the history
…layedv3_2024.05.15

Merge rc17next1 into feat/relayedv3 2024.05.15
  • Loading branch information
AdoAdoAdo authored May 16, 2024
2 parents d31d68b + 637df8d commit ab49574
Show file tree
Hide file tree
Showing 209 changed files with 6,536 additions and 2,109 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
strategy:
matrix:
runs-on: [ubuntu-latest, macos-latest, macos-13-xlarge]
runs-on: [ubuntu-latest, macos-13-xlarge]
runs-on: ${{ matrix.runs-on }}
name: Build
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
strategy:
matrix:
runs-on: [ubuntu-latest, macos-latest, macos-13-xlarge]
runs-on: [ubuntu-latest, macos-13-xlarge]
runs-on: ${{ matrix.runs-on }}
name: Build
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- master
pull_request:
branches: [ master, feat/*, rc/* ]
workflow_dispatch:

permissions:
contents: read
Expand Down
9 changes: 9 additions & 0 deletions api/groups/addressGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
urlParamBlockHash = "blockHash"
urlParamBlockRootHash = "blockRootHash"
urlParamHintEpoch = "hintEpoch"
urlParamWithKeys = "withKeys"
)

// addressFacadeHandler defines the methods to be implemented by a facade for handling address requests
Expand Down Expand Up @@ -185,6 +186,14 @@ func (ag *addressGroup) getAccount(c *gin.Context) {
return
}

withKeys, err := parseBoolUrlParam(c, urlParamWithKeys)
if err != nil {
shared.RespondWithValidationError(c, errors.ErrCouldNotGetAccount, err)
return
}

options.WithKeys = withKeys

accountResponse, blockInfo, err := ag.getFacade().GetAccount(addr, options)
if err != nil {
shared.RespondWithInternalError(c, errors.ErrCouldNotGetAccount, err)
Expand Down
6 changes: 6 additions & 0 deletions cmd/node/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@
{ StartEpoch = 0, Version = "v1.4" },
{ StartEpoch = 1, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
]
TransferAndExecuteByUserAddresses = [ # TODO: set real contract addresses for all shards
"erd1qqqqqqqqqqqqqpgqr46jrxr6r2unaqh75ugd308dwx5vgnhwh47qtvepe3", #shard 0
]

[VirtualMachine.Querying]
NumConcurrentVMs = 1
Expand All @@ -684,6 +687,9 @@
{ StartEpoch = 0, Version = "v1.4" },
{ StartEpoch = 1, Version = "v1.5" }, # TODO: set also the RoundActivations.DisableAsyncCallV1 accordingly
]
TransferAndExecuteByUserAddresses = [ # TODO: set real contract addresses for all shards
"erd1qqqqqqqqqqqqqpgqr46jrxr6r2unaqh75ugd308dwx5vgnhwh47qtvepe3",
]

[VirtualMachine.GasConfig]
# The following values define the maximum amount of gas to be allocated for VM Queries coming from API
Expand Down
23 changes: 16 additions & 7 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -285,25 +285,34 @@
FixGasRemainingForSaveKeyValueBuiltinFunctionEnableEpoch = 1

# CurrentRandomnessOnSortingEnableEpoch represents the epoch when the current randomness on sorting is enabled
CurrentRandomnessOnSortingEnableEpoch = 4
CurrentRandomnessOnSortingEnableEpoch = 1

# StakeLimitsEnableEpoch represents the epoch when stake limits on validators are enabled
# Should have the same value as StakingV4Step1EnableEpoch that triggers the automatic unstake operations for the queue nodes
StakeLimitsEnableEpoch = 4
StakeLimitsEnableEpoch = 1

# StakingV4Step1EnableEpoch represents the epoch when staking v4 is initialized. This is the epoch in which
# all nodes from staking queue are moved in the auction list
StakingV4Step1EnableEpoch = 4
StakingV4Step1EnableEpoch = 1

# StakingV4Step2EnableEpoch represents the epoch when staking v4 is enabled. Should have a greater value than StakingV4Step1EnableEpoch.
# From this epoch, all shuffled out nodes are moved to auction nodes. No auction nodes selection is done yet.
StakingV4Step2EnableEpoch = 5
StakingV4Step2EnableEpoch = 2

# StakingV4Step3EnableEpoch represents the epoch in which selected nodes from auction will be distributed to waiting list
StakingV4Step3EnableEpoch = 6
StakingV4Step3EnableEpoch = 3

# AlwaysMergeContextsInEEIEnableEpoch represents the epoch in which the EEI will always merge the contexts
AlwaysMergeContextsInEEIEnableEpoch = 4
AlwaysMergeContextsInEEIEnableEpoch = 1

# DynamicESDTEnableEpoch represents the epoch when dynamic NFT feature is enabled
DynamicESDTEnableEpoch = 4

# EGLDInMultiTransferEnableEpoch represents the epoch when EGLD in multitransfer is enabled
EGLDInMultiTransferEnableEpoch = 4

# CryptoOpcodesV2EnableEpoch represents the epoch when BLSMultiSig, Secp256r1 and other opcodes are enabled
CryptoOpcodesV2EnableEpoch = 4

# RelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions V3 will be enabled
RelayedTransactionsV3EnableEpoch = 7
Expand All @@ -325,7 +334,7 @@
# - Enable epoch = StakingV4Step3EnableEpoch
# - NodesToShufflePerShard = same as previous entry in MaxNodesChangeEnableEpoch
# - MaxNumNodes = (MaxNumNodesFromPreviousEpochEnable - (numOfShards+1)*NodesToShufflePerShard)
{ EpochEnable = 6, MaxNumNodes = 56, NodesToShufflePerShard = 2 },
{ EpochEnable = 3, MaxNumNodes = 56, NodesToShufflePerShard = 2 },
]

[GasSchedule]
Expand Down
8 changes: 8 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
ESDTNFTAddUri = 500000
ESDTNFTUpdateAttributes = 500000
ESDTNFTMultiTransfer = 1000000
ESDTModifyRoyalties = 500000
ESDTModifyCreator = 500000
ESDTNFTRecreate = 1000000
ESDTNFTUpdate = 1000000
ESDTNFTSetNewURIs = 500000
SetGuardian = 250000
GuardAccount = 250000
UnGuardAccount = 250000
Expand Down Expand Up @@ -206,6 +211,9 @@
UnmarshalCompressedECC = 270000
GenerateKeyECC = 7000000
EncodeDERSig = 10000000
VerifySecp256r1 = 2000000
VerifyBLSSignatureShare = 2000000
VerifyBLSMultiSig = 2000000

[ManagedBufferAPICost]
MBufferNew = 2000
Expand Down
8 changes: 8 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
ESDTNFTAddUri = 500000
ESDTNFTUpdateAttributes = 500000
ESDTNFTMultiTransfer = 1000000
ESDTModifyRoyalties = 500000
ESDTModifyCreator = 500000
ESDTNFTRecreate = 1000000
ESDTNFTUpdate = 1000000
ESDTNFTSetNewURIs = 500000
SetGuardian = 250000
GuardAccount = 250000
UnGuardAccount = 250000
Expand Down Expand Up @@ -206,6 +211,9 @@
UnmarshalCompressedECC = 270000
GenerateKeyECC = 7000000
EncodeDERSig = 10000000
VerifySecp256r1 = 2000000
VerifyBLSSignatureShare = 2000000
VerifyBLSMultiSig = 2000000

[ManagedBufferAPICost]
MBufferNew = 2000
Expand Down
8 changes: 8 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
ESDTNFTAddUri = 500000
ESDTNFTUpdateAttributes = 500000
ESDTNFTMultiTransfer = 1000000
ESDTModifyRoyalties = 500000
ESDTModifyCreator = 500000
ESDTNFTRecreate = 1000000
ESDTNFTUpdate = 1000000
ESDTNFTSetNewURIs = 500000
SetGuardian = 250000
GuardAccount = 250000
UnGuardAccount = 250000
Expand Down Expand Up @@ -206,6 +211,9 @@
UnmarshalCompressedECC = 270000
GenerateKeyECC = 7000000
EncodeDERSig = 10000000
VerifySecp256r1 = 2000000
VerifyBLSSignatureShare = 2000000
VerifyBLSMultiSig = 2000000

[ManagedBufferAPICost]
MBufferNew = 2000
Expand Down
8 changes: 8 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV4.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
ESDTNFTAddUri = 50000
ESDTNFTUpdateAttributes = 50000
ESDTNFTMultiTransfer = 200000
ESDTModifyRoyalties = 500000
ESDTModifyCreator = 500000
ESDTNFTRecreate = 1000000
ESDTNFTUpdate = 1000000
ESDTNFTSetNewURIs = 500000
SetGuardian = 250000
GuardAccount = 250000
UnGuardAccount = 250000
Expand Down Expand Up @@ -206,6 +211,9 @@
UnmarshalCompressedECC = 270000
GenerateKeyECC = 7000000
EncodeDERSig = 10000000
VerifySecp256r1 = 2000000
VerifyBLSSignatureShare = 2000000
VerifyBLSMultiSig = 2000000

[ManagedBufferAPICost]
MBufferNew = 2000
Expand Down
8 changes: 8 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV5.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
ESDTNFTAddUri = 50000
ESDTNFTUpdateAttributes = 50000
ESDTNFTMultiTransfer = 200000
ESDTModifyRoyalties = 500000
ESDTModifyCreator = 500000
ESDTNFTRecreate = 1000000
ESDTNFTUpdate = 1000000
ESDTNFTSetNewURIs = 500000
SetGuardian = 250000
GuardAccount = 250000
UnGuardAccount = 250000
Expand Down Expand Up @@ -206,6 +211,9 @@
UnmarshalCompressedECC = 270000
GenerateKeyECC = 7000000
EncodeDERSig = 10000000
VerifySecp256r1 = 2000000
VerifyBLSSignatureShare = 2000000
VerifyBLSMultiSig = 2000000

[ManagedBufferAPICost]
MBufferNew = 2000
Expand Down
8 changes: 8 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV6.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
ESDTNFTAddUri = 50000
ESDTNFTUpdateAttributes = 50000
ESDTNFTMultiTransfer = 200000
ESDTModifyRoyalties = 500000
ESDTModifyCreator = 500000
ESDTNFTRecreate = 1000000
ESDTNFTUpdate = 1000000
ESDTNFTSetNewURIs = 500000
SetGuardian = 250000
GuardAccount = 250000
UnGuardAccount = 250000
Expand Down Expand Up @@ -206,6 +211,9 @@
UnmarshalCompressedECC = 270000
GenerateKeyECC = 7000000
EncodeDERSig = 10000000
VerifySecp256r1 = 2000000
VerifyBLSSignatureShare = 2000000
VerifyBLSMultiSig = 2000000

[ManagedBufferAPICost]
MBufferNew = 2000
Expand Down
8 changes: 8 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV7.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
ESDTNFTUpdateAttributes = 50000
ESDTNFTMultiTransfer = 200000
MultiESDTNFTTransfer = 200000 # should be the same value with the ESDTNFTMultiTransfer
ESDTModifyRoyalties = 500000
ESDTModifyCreator = 500000
ESDTNFTRecreate = 1000000
ESDTNFTUpdate = 1000000
ESDTNFTSetNewURIs = 500000
SetGuardian = 250000
GuardAccount = 250000
UnGuardAccount = 250000
Expand Down Expand Up @@ -207,6 +212,9 @@
UnmarshalCompressedECC = 270000
GenerateKeyECC = 7000000
EncodeDERSig = 10000000
VerifySecp256r1 = 2000000
VerifyBLSSignatureShare = 2000000
VerifyBLSMultiSig = 2000000

[ManagedBufferAPICost]
MBufferNew = 2000
Expand Down
3 changes: 2 additions & 1 deletion cmd/node/config/prefs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
# The Path indicates what value to change, while Value represents the new value. The node operator must make sure
# to follow the same type of the original value (ex: uint32: 37, float32: 37.0, bool: true)
# Also, the Value can be a struct (ex: { StartEpoch = 0, Version = "1.5" }) or an array (ex: [{ StartEpoch = 0, Version = "1.4" }, { StartEpoch = 1, Version = "1.5" }])
# File represents the file name that holds the configuration. Currently, the supported files are: config.toml, external.toml, p2p.toml, enableEpochs.toml and fullArchiveP2P.toml
# File represents the file name that holds the configuration. Currently, the supported files are:
# api.toml, config.toml, economics.toml, enableEpochs.toml, enableRounds.toml, external.toml, fullArchiveP2P.toml, p2p.toml, ratings.toml, systemSmartContractsConfig.toml
# -------------------------------
# Un-comment and update the following section in order to enable config values overloading
# -------------------------------
Expand Down
4 changes: 2 additions & 2 deletions cmd/node/config/systemSmartContractsConfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
BleedPercentagePerRound = 0.00001
MaxNumberOfNodesForStake = 64
UnJailValue = "2500000000000000000" #0.1% of genesis node price
ActivateBLSPubKeyMessageVerification = false
ActivateBLSPubKeyMessageVerification = true
StakeLimitPercentage = 1.0 #fraction of value 1 - 100%, for the time being no stake limit
NodeLimitPercentage = 0.1 #fraction of value 0.1 - 10%

Expand All @@ -35,7 +35,7 @@

[DelegationManagerSystemSCConfig]
MinCreationDeposit = "1250000000000000000000" #1.25K eGLD
MinStakeAmount = "10000000000000000000" #10 eGLD
MinStakeAmount = "1000000000000000000" #1 eGLD
ConfigChangeAddress = "erd1vxy22x0fj4zv6hktmydg8vpfh6euv02cz4yg0aaws6rrad5a5awqgqky80" #should use a multisign contract instead of a wallet address

[DelegationSystemSCConfig]
Expand Down
7 changes: 6 additions & 1 deletion common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ const MetricCurrentRound = "erd_current_round"
// MetricNonce is the metric for monitoring the nonce of a node
const MetricNonce = "erd_nonce"

// MetricBlockTimestamp is the metric for monitoring the timestamp of the last synchronized block
const MetricBlockTimestamp = "erd_block_timestamp"

// MetricProbableHighestNonce is the metric for monitoring the max speculative nonce received by the node by listening on the network
const MetricProbableHighestNonce = "erd_probable_highest_nonce"

Expand Down Expand Up @@ -1014,9 +1017,11 @@ const (
StakingV4Step1Flag core.EnableEpochFlag = "StakingV4Step1Flag"
StakingV4Step2Flag core.EnableEpochFlag = "StakingV4Step2Flag"
StakingV4Step3Flag core.EnableEpochFlag = "StakingV4Step3Flag"
StakingQueueFlag core.EnableEpochFlag = "StakingQueueFlag"
StakingV4StartedFlag core.EnableEpochFlag = "StakingV4StartedFlag"
AlwaysMergeContextsInEEIFlag core.EnableEpochFlag = "AlwaysMergeContextsInEEIFlag"
DynamicESDTFlag core.EnableEpochFlag = "DynamicEsdtFlag"
EGLDInESDTMultiTransferFlag core.EnableEpochFlag = "EGLDInESDTMultiTransferFlag"
CryptoOpcodesV2Flag core.EnableEpochFlag = "CryptoOpcodesV2Flag"
RelayedTransactionsV3Flag core.EnableEpochFlag = "RelayedTransactionsV3Flag"
FixRelayedMoveBalanceFlag core.EnableEpochFlag = "FixRelayedMoveBalanceFlag"
// all new flags must be added to createAllFlagsMap method, as part of enableEpochsHandler allFlagsDefined
Expand Down
24 changes: 18 additions & 6 deletions common/enablers/enableEpochsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,12 +713,6 @@ func (handler *enableEpochsHandler) createAllFlagsMap() {
},
activationEpoch: handler.enableEpochsConfig.StakingV4Step3EnableEpoch,
},
common.StakingQueueFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch < handler.enableEpochsConfig.StakingV4Step1EnableEpoch
},
activationEpoch: handler.enableEpochsConfig.StakingV4Step1EnableEpoch,
},
common.StakingV4StartedFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.StakingV4Step1EnableEpoch
Expand All @@ -731,6 +725,24 @@ func (handler *enableEpochsHandler) createAllFlagsMap() {
},
activationEpoch: handler.enableEpochsConfig.AlwaysMergeContextsInEEIEnableEpoch,
},
common.DynamicESDTFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.DynamicESDTEnableEpoch
},
activationEpoch: handler.enableEpochsConfig.DynamicESDTEnableEpoch,
},
common.EGLDInESDTMultiTransferFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.EGLDInMultiTransferEnableEpoch
},
activationEpoch: handler.enableEpochsConfig.EGLDInMultiTransferEnableEpoch,
},
common.CryptoOpcodesV2Flag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.CryptoOpcodesV2EnableEpoch
},
activationEpoch: handler.enableEpochsConfig.CryptoOpcodesV2EnableEpoch,
},
common.RelayedTransactionsV3Flag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.RelayedTransactionsV3EnableEpoch
Expand Down
Loading

0 comments on commit ab49574

Please sign in to comment.