Skip to content

Commit

Permalink
Merge branch 'feat/chain-go-sdk' into chain-go-sdk-benchmarks-02
Browse files Browse the repository at this point in the history
  • Loading branch information
raduchis committed May 16, 2024
2 parents 0b74e05 + e1f9dfd commit 6f6f083
Show file tree
Hide file tree
Showing 325 changed files with 10,876 additions and 4,213 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 @@ -676,6 +676,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 @@ -685,6 +688,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
9 changes: 9 additions & 0 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@
# AlwaysMergeContextsInEEIEnableEpoch represents the epoch in which the EEI will always merge the contexts
AlwaysMergeContextsInEEIEnableEpoch = 4

# 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

# ConsensusModelV2EnableEpoch represents the epoch when the consensus model V2 is enabled
ConsensusModelV2EnableEpoch = 2

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
1 change: 1 addition & 0 deletions cmd/sovereignnode/config/prefs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
OverridableConfigTomlValues = [
{ File = "config.toml", Path = "VirtualMachine.Execution.WasmVMVersions", Value = [{ StartEpoch = 0, Version = "v1.5" }] },
{ File = "config.toml", Path = "VirtualMachine.Querying.WasmVMVersions", Value = [{ StartEpoch = 0, Version = "v1.5" }] },
{ File = "systemSmartContractsConfig.toml", Path = "ESDTSystemSCConfig.BaseIssuingCost", Value = "50000000000000000" },
]

# BlockProcessingCutoff can be used to stop processing blocks at a certain round, nonce or epoch.
Expand Down
2 changes: 1 addition & 1 deletion cmd/sovereignnode/dataCodec/dataCodec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/require"
)

func createDataCodec() SovereignDataDecoder {
func createDataCodec() SovereignDataCodec {
codec := abi.NewDefaultCodec()
args := ArgsDataCodec{
Serializer: abi.NewSerializer(codec),
Expand Down
4 changes: 2 additions & 2 deletions cmd/sovereignnode/dataCodec/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type OperationDataEncoder interface {
SerializeOperation(operation sovereign.Operation) ([]byte, error)
}

// SovereignDataDecoder is the interface for serializing/deserializing data
type SovereignDataDecoder interface {
// SovereignDataCodec is the interface for serializing/deserializing data
type SovereignDataCodec interface {
SerializeEventData(eventData sovereign.EventData) ([]byte, error)
DeserializeEventData(data []byte) (*sovereign.EventData, error)
SerializeTokenData(tokenData sovereign.EsdtTokenData) ([]byte, error)
Expand Down
24 changes: 12 additions & 12 deletions cmd/sovereignnode/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ go 1.20

require (
github.com/google/gops v0.3.18
github.com/multiversx/mx-chain-core-go v1.2.20-0.20240328111817-b846b1c176aa
github.com/multiversx/mx-chain-core-go v1.2.21-0.20240514102932-72b1cac83784
github.com/multiversx/mx-chain-go v1.6.3
github.com/multiversx/mx-chain-logger-go v1.0.14-0.20240129144507-d00e967c890c
github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57
github.com/multiversx/mx-chain-sovereign-bridge-go v0.0.0-20240116102202-4cf6fbbd95a3
github.com/multiversx/mx-chain-sovereign-notifier-go v0.0.0-20230929085947-df9b345f49ac
github.com/multiversx/mx-sdk-abi-incubator/golang v0.0.0-20240304123830-5b63f9782aea
Expand Down Expand Up @@ -118,16 +118,16 @@ require (
github.com/multiformats/go-multistream v0.4.1 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/multiversx/concurrent-map v0.1.4 // indirect
github.com/multiversx/mx-chain-communication-go v1.0.13-0.20240321151517-2fffad77c605 // indirect
github.com/multiversx/mx-chain-crypto-go v1.2.10-0.20231206065052-38843c1f1479 // indirect
github.com/multiversx/mx-chain-es-indexer-go v1.4.20-0.20240228094052-28a36809b9b8 // indirect
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240212160120-cc32d1580157 // indirect
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240321150623-3974ec1d6474 // indirect
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240328112153-dcc93e27e9b7 // indirect
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240321153018-3e5a88ba7368 // indirect
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.66-0.20240321152247-79521988c8e6 // indirect
github.com/multiversx/mx-chain-vm-v1_3-go v1.3.67-0.20240321152532-45da5eabdc38 // indirect
github.com/multiversx/mx-chain-vm-v1_4-go v1.4.96-0.20240321152756-16110ce9d968 // indirect
github.com/multiversx/mx-chain-communication-go v1.0.15-0.20240508074652-e128a1c05c8e // indirect
github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240508074452-cc21c1b505df // indirect
github.com/multiversx/mx-chain-es-indexer-go v1.7.2-0.20240514123403-92975ee00840 // indirect
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240509103754-9e8129721f00 // indirect
github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240508073549-dcb8e6e0370f // indirect
github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240516094756-46c23d07c6e2 // indirect
github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240509104139-8b0eaa8a85d1 // indirect
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240509103859-89de3c5da36b // indirect
github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240509104009-598a37ff36b9 // indirect
github.com/multiversx/mx-chain-vm-v1_4-go v1.4.98-0.20240509104102-2a6a709b4041 // indirect
github.com/multiversx/mx-components-big-int v1.0.0 // indirect
github.com/onsi/ginkgo/v2 v2.9.7 // indirect
github.com/opencontainers/runtime-spec v1.0.2 // indirect
Expand Down

0 comments on commit 6f6f083

Please sign in to comment.