Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev into liquid staking 09 06 2022 #4183

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
20c9c72
update indexer
miiu96 May 3, 2022
0662e00
integrate new interface
sasurobert May 4, 2022
c3fff4a
integrate new interface
sasurobert May 4, 2022
b6f646b
integrate new interface
sasurobert May 4, 2022
fbd5a7e
fix after review
sasurobert May 12, 2022
052214a
go mod tidy
sasurobert May 12, 2022
f9acc0b
added forgotten gas schedule
sasurobert May 12, 2022
0c156ea
Merge pull request #4016 from ElrondNetwork/rc/2022-may
iulianpascalau May 19, 2022
728fcfd
- create releases from rc branches
iulianpascalau May 19, 2022
74ac8f8
Merge pull request #4088 from ElrondNetwork/create-releases-on-rc-bra…
iulianpascalau May 19, 2022
e9bb438
Merge branch 'master' into update-master-in-rc-june-2022.05.19
iulianpascalau May 19, 2022
d9f7b2c
Merge pull request #4089 from ElrondNetwork/update-master-in-rc-june-…
iulianpascalau May 19, 2022
b98ec2e
fix token type log
bogdan-rosianu May 19, 2022
4c334e9
Merge pull request #4090 from ElrondNetwork/fix-token-type-log-regist…
bogdan-rosianu May 20, 2022
856bfde
Merge branch 'master' into merge-master-rc-2022-june
bogdan-rosianu May 20, 2022
140c564
Merge pull request #4096 from ElrondNetwork/merge-master-rc-2022-june
iulianpascalau May 20, 2022
55b68b5
Merge remote-tracking branch 'origin/rc/2022-june' into vm-common-vm-…
sasurobert May 23, 2022
547d5fb
new vm
sasurobert May 23, 2022
fbc5316
new vm
sasurobert May 24, 2022
4d5a5c8
Merge pull request #4072 from ElrondNetwork/vm-common-vm-may-5
sasurobert May 24, 2022
bf59836
Merge branch 'rc/2022-june' into rc-june-to-dev-may-26
sasurobert May 26, 2022
c26ce58
config test
sasurobert May 26, 2022
ee20d8f
Merge pull request #4113 from ElrondNetwork/rc-june-to-dev-may-26
iulianpascalau May 30, 2022
2a930b0
Merge branch 'development' into integrate-indexer-partion-exec
miiu96 May 30, 2022
d05d08c
indexer partial execution
miiu96 May 30, 2022
7eb372b
do not return not executed transactions
miiu96 May 30, 2022
eed8950
fix unit tests
miiu96 May 30, 2022
daeaa8e
- fixed init call on transaction coordinator when processing a new mi…
iulianpascalau May 30, 2022
1d06408
- removed TODO, added comment + log.Warn
iulianpascalau May 31, 2022
8cc08b0
integrate new vmcommon
sasurobert May 31, 2022
520d388
fixed Test_getProcessedMiniBlocks that failed from time to time
bogdan-rosianu May 31, 2022
5ecc5a5
fixes after review and unit test
miiu96 May 31, 2022
e3bdfc9
Merge pull request #4143 from ElrondNetwork/fix-getProcessedMiniBlock…
bogdan-rosianu Jun 1, 2022
e0f23b7
Merge branch 'development' into fix-init-in-transaction-coordinator
gabi-vuls Jun 1, 2022
fc149cf
fixes after second review
miiu96 Jun 2, 2022
8f6dd14
Merge branch 'development' into integrate-indexer-partion-exec
miiu96 Jun 2, 2022
6268d14
Merge pull request #4135 from ElrondNetwork/fix-init-in-transaction-c…
iulianpascalau Jun 2, 2022
b1036d4
fix config
sasurobert Jun 2, 2022
3d41168
fixes
sasurobert Jun 2, 2022
34812ec
new vmcommon
sasurobert Jun 2, 2022
7b122ee
Merge branch 'development' into vmcommon-storage-updates
sasurobert Jun 2, 2022
04713ad
fix stub
sasurobert Jun 3, 2022
23f75b2
Merge remote-tracking branch 'origin/vmcommon-storage-updates' into v…
sasurobert Jun 3, 2022
aa33070
indexer with partial execution integration
miiu96 Jun 7, 2022
b723afd
Merge branch 'development' into integrate-indexer-partion-exec
miiu96 Jun 7, 2022
c858849
Merge pull request #4052 from ElrondNetwork/integrate-indexer-partion…
miiu96 Jun 7, 2022
34f5f65
Merge branch 'development' into vmcommon-storage-updates
sasurobert Jun 8, 2022
954fde2
goimports
sasurobert Jun 8, 2022
04516ad
Merge pull request #4150 from ElrondNetwork/vmcommon-storage-updates
sasurobert Jun 8, 2022
cba9230
Merge branch 'development' into merge-dev-into-liquid-staking-09-06-2022
mariusmihaic Jun 9, 2022
7fff5b8
FIX: Package import
mariusmihaic Jun 9, 2022
4a19f66
FIX: Merge conflict
mariusmihaic Jun 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- main
- rc/*
workflow_dispatch:

permissions:
Expand Down
3 changes: 3 additions & 0 deletions cmd/node/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@
# If set to 0, then MaxUInt64 will be used
MaxGasPerVmQuery = 1500000000 #1.5b

[BuiltInFunctions]
AutomaticCrawlerAddress = "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c"

[Hardfork]
EnableTrigger = true
EnableTriggerFromP2P = true
Expand Down
6 changes: 6 additions & 0 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@
# FailExecutionOnEveryAPIErrorEnableEpoch represent the epoch when new protection in VM is enabled to fail all wrong API calls
FailExecutionOnEveryAPIErrorEnableEpoch = 3

# ManagedCryptoAPIsEnableEpoch represents the epoch when new managed crypto APIs are enabled in the wasm VM
ManagedCryptoAPIsEnableEpoch = 4

# ESDTMetadataContinuousCleanupEnableEpoch represents the epoch when esdt metadata is automatically deleted according to inshard liquidity
ESDTMetadataContinuousCleanupEnableEpoch = 4

# StakeLimitsEnableEpoch represents the epoch when stake limits on validators are enabled
StakeLimitsEnableEpoch = 5

Expand Down
22 changes: 22 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@
MBufferGetArgument = 1000
MBufferFinish = 1000
MBufferSetRandom = 6000
MBufferToBigFloat = 2000
MBufferFromBigFloat = 2000

[BigFloatAPICost]
BigFloatNewFromParts = 3000
BigFloatAdd = 7000
BigFloatSub = 7000
BigFloatMul = 7000
BigFloatDiv = 7000
BigFloatTruncate = 5000
BigFloatNeg = 5000
BigFloatClone = 5000
BigFloatCmp = 4000
BigFloatAbs = 5000
BigFloatSqrt = 7000
BigFloatPow = 10000
BigFloatFloor = 5000
BigFloatCeil = 5000
BigFloatIsInt = 3000
BigFloatSetBigInt = 3000
BigFloatSetInt64 = 1000
BigFloatGetConst = 1000

[WASMOpcodeCost]
Unreachable = 1
Expand Down
22 changes: 22 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@
MBufferGetArgument = 1000
MBufferFinish = 1000
MBufferSetRandom = 6000
MBufferToBigFloat = 2000
MBufferFromBigFloat = 2000

[BigFloatAPICost]
BigFloatNewFromParts = 3000
BigFloatAdd = 7000
BigFloatSub = 7000
BigFloatMul = 7000
BigFloatDiv = 7000
BigFloatTruncate = 5000
BigFloatNeg = 5000
BigFloatClone = 5000
BigFloatCmp = 4000
BigFloatAbs = 5000
BigFloatSqrt = 7000
BigFloatPow = 10000
BigFloatFloor = 5000
BigFloatCeil = 5000
BigFloatIsInt = 3000
BigFloatSetBigInt = 3000
BigFloatSetInt64 = 1000
BigFloatGetConst = 1000

[WASMOpcodeCost]
Unreachable = 1
Expand Down
22 changes: 22 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@
MBufferGetArgument = 1000
MBufferFinish = 1000
MBufferSetRandom = 6000
MBufferToBigFloat = 2000
MBufferFromBigFloat = 2000

[BigFloatAPICost]
BigFloatNewFromParts = 3000
BigFloatAdd = 7000
BigFloatSub = 7000
BigFloatMul = 7000
BigFloatDiv = 7000
BigFloatTruncate = 5000
BigFloatNeg = 5000
BigFloatClone = 5000
BigFloatCmp = 4000
BigFloatAbs = 5000
BigFloatSqrt = 7000
BigFloatPow = 10000
BigFloatFloor = 5000
BigFloatCeil = 5000
BigFloatIsInt = 3000
BigFloatSetBigInt = 3000
BigFloatSetInt64 = 1000
BigFloatGetConst = 1000

[WASMOpcodeCost]
Unreachable = 1
Expand Down
22 changes: 22 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV4.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@
MBufferGetArgument = 1000
MBufferFinish = 1000
MBufferSetRandom = 6000
MBufferToBigFloat = 2000
MBufferFromBigFloat = 2000

[BigFloatAPICost]
BigFloatNewFromParts = 3000
BigFloatAdd = 7000
BigFloatSub = 7000
BigFloatMul = 7000
BigFloatDiv = 7000
BigFloatTruncate = 5000
BigFloatNeg = 5000
BigFloatClone = 5000
BigFloatCmp = 4000
BigFloatAbs = 5000
BigFloatSqrt = 7000
BigFloatPow = 10000
BigFloatFloor = 5000
BigFloatCeil = 5000
BigFloatIsInt = 3000
BigFloatSetBigInt = 3000
BigFloatSetInt64 = 1000
BigFloatGetConst = 1000

[WASMOpcodeCost]
Unreachable = 5
Expand Down
22 changes: 22 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV5.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@
MBufferGetArgument = 1000
MBufferFinish = 1000
MBufferSetRandom = 6000
MBufferToBigFloat = 2000
MBufferFromBigFloat = 2000

[BigFloatAPICost]
BigFloatNewFromParts = 3000
BigFloatAdd = 7000
BigFloatSub = 7000
BigFloatMul = 7000
BigFloatDiv = 7000
BigFloatTruncate = 5000
BigFloatNeg = 5000
BigFloatClone = 5000
BigFloatCmp = 4000
BigFloatAbs = 5000
BigFloatSqrt = 7000
BigFloatPow = 10000
BigFloatFloor = 5000
BigFloatCeil = 5000
BigFloatIsInt = 3000
BigFloatSetBigInt = 3000
BigFloatSetInt64 = 1000
BigFloatGetConst = 1000

[WASMOpcodeCost]
Unreachable = 5
Expand Down
22 changes: 22 additions & 0 deletions cmd/node/config/gasSchedules/gasScheduleV6.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@
MBufferGetArgument = 1000
MBufferFinish = 1000
MBufferSetRandom = 6000
MBufferToBigFloat = 2000
MBufferFromBigFloat = 2000

[BigFloatAPICost]
BigFloatNewFromParts = 3000
BigFloatAdd = 7000
BigFloatSub = 7000
BigFloatMul = 7000
BigFloatDiv = 7000
BigFloatTruncate = 5000
BigFloatNeg = 5000
BigFloatClone = 5000
BigFloatCmp = 4000
BigFloatAbs = 5000
BigFloatSqrt = 7000
BigFloatPow = 10000
BigFloatFloor = 5000
BigFloatCeil = 5000
BigFloatIsInt = 3000
BigFloatSetBigInt = 3000
BigFloatSetInt64 = 1000
BigFloatGetConst = 1000

[WASMOpcodeCost]
Unreachable = 5
Expand Down
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ type Config struct {
HeadersPoolConfig HeadersPoolConfig
BlockSizeThrottleConfig BlockSizeThrottleConfig
VirtualMachine VirtualMachineServicesConfig
BuiltInFunctions BuiltInFunctionsConfig

Hardfork HardforkConfig
Debug DebugConfig
Expand Down Expand Up @@ -417,6 +418,11 @@ type VirtualMachineGasConfig struct {
MaxGasPerVmQuery uint64
}

// BuiltInFunctionsConfig holds the configuration for the built in functions
type BuiltInFunctionsConfig struct {
AutomaticCrawlerAddress string
}

// HardforkConfig holds the configuration for the hardfork trigger
type HardforkConfig struct {
ExportStateStorageConfig StorageConfig
Expand Down
2 changes: 2 additions & 0 deletions config/epochConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ type EnableEpochs struct {
SCRSizeInvariantOnBuiltInResultEnableEpoch uint32
CheckCorrectTokenIDForTransferRoleEnableEpoch uint32
FailExecutionOnEveryAPIErrorEnableEpoch uint32
ManagedCryptoAPIsEnableEpoch uint32
HeartbeatDisableEpoch uint32
MiniBlockPartialExecutionEnableEpoch uint32
ESDTMetadataContinuousCleanupEnableEpoch uint32
StakeLimitsEnableEpoch uint32
StakingV4InitEnableEpoch uint32
StakingV4EnableEpoch uint32
Expand Down
12 changes: 10 additions & 2 deletions config/tomlConfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,14 @@ func TestEnableEpochConfig(t *testing.T) {
# FailExecutionOnEveryAPIErrorEnableEpoch represent the epoch when new protection in VM is enabled to fail all wrong API calls
FailExecutionOnEveryAPIErrorEnableEpoch = 53

# ManagedCryptoAPIsEnableEpoch represents the epoch when the new managed crypto APIs are enabled
ManagedCryptoAPIsEnableEpoch = 54

# HeartbeatDisableEpoch represents the epoch when heartbeat v1 messages stop being sent and processed
HeartbeatDisableEpoch = 54
HeartbeatDisableEpoch = 55

# ESDTMetadataContinuousCleanupEnableEpoch represents the epoch when esdt metadata is automatically deleted according to inshard liquidity
ESDTMetadataContinuousCleanupEnableEpoch = 56

# MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MaxNodesChangeEnableEpoch = [
Expand Down Expand Up @@ -737,7 +743,9 @@ func TestEnableEpochConfig(t *testing.T) {
TransformToMultiShardCreateEnableEpoch: 51,
ESDTRegisterAndSetAllRolesEnableEpoch: 52,
FailExecutionOnEveryAPIErrorEnableEpoch: 53,
HeartbeatDisableEpoch: 54,
ManagedCryptoAPIsEnableEpoch: 54,
HeartbeatDisableEpoch: 55,
ESDTMetadataContinuousCleanupEnableEpoch: 56,
},
GasSchedule: GasScheduleConfig{
GasScheduleByEpochs: []GasScheduleByEpochs{
Expand Down
17 changes: 11 additions & 6 deletions epochStart/bootstrap/shardStorageHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1417,16 +1417,21 @@ func Test_getProcessedMiniBlocks(t *testing.T) {

processedMiniBlocks = getProcessedMiniBlocks(metaBlock, 0, processedMiniBlocks, referencedMetaBlockHash)

idxOfMiniBlock0, idxOfMiniBlock1 := 0, 1
if bytes.Equal(processedMiniBlocks[0].MiniBlocksHashes[0], mbHash2) {
idxOfMiniBlock0, idxOfMiniBlock1 = 1, 0
}

require.Equal(t, 1, len(processedMiniBlocks))
require.Equal(t, 2, len(processedMiniBlocks[0].MiniBlocksHashes))
require.Equal(t, 2, len(processedMiniBlocks[0].IndexOfLastTxProcessed))
require.Equal(t, 2, len(processedMiniBlocks[0].FullyProcessed))

require.Equal(t, referencedMetaBlockHash, processedMiniBlocks[0].MetaHash)
assert.Equal(t, int32(mbh1.TxCount-2), processedMiniBlocks[0].IndexOfLastTxProcessed[0])
assert.Equal(t, int32(mbh1.TxCount-1), processedMiniBlocks[0].IndexOfLastTxProcessed[1])
assert.False(t, processedMiniBlocks[0].FullyProcessed[0])
assert.True(t, processedMiniBlocks[0].FullyProcessed[1])
assert.Equal(t, mbHash1, processedMiniBlocks[0].MiniBlocksHashes[0])
assert.Equal(t, mbHash2, processedMiniBlocks[0].MiniBlocksHashes[1])
assert.Equal(t, int32(mbh1.TxCount-2), processedMiniBlocks[0].IndexOfLastTxProcessed[idxOfMiniBlock0])
assert.Equal(t, int32(mbh1.TxCount-1), processedMiniBlocks[0].IndexOfLastTxProcessed[idxOfMiniBlock1])
assert.False(t, processedMiniBlocks[0].FullyProcessed[idxOfMiniBlock0])
assert.True(t, processedMiniBlocks[0].FullyProcessed[idxOfMiniBlock1])
assert.Equal(t, mbHash1, processedMiniBlocks[0].MiniBlocksHashes[idxOfMiniBlock0])
assert.Equal(t, mbHash2, processedMiniBlocks[0].MiniBlocksHashes[idxOfMiniBlock1])
}
29 changes: 15 additions & 14 deletions epochStart/metachain/systemSCs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,23 +749,24 @@ func createFullArgumentsForSystemSCProcessing(stakingV2EnableEpoch uint32, trieS
}},
EpochNotifier: &epochNotifier.EpochNotifierStub{},
}
builtInFuncs, _, _ := builtInFunctions.CreateBuiltInFuncContainerAndNFTStorageHandler(argsBuiltIn)
builtInFuncs, _, _, _ := builtInFunctions.CreateBuiltInFuncContainerAndNFTStorageHandler(argsBuiltIn)

testDataPool := dataRetrieverMock.NewPoolsHolderMock()
argsHook := hooks.ArgBlockChainHook{
Accounts: userAccountsDB,
PubkeyConv: &mock.PubkeyConverterMock{},
StorageService: &mock.ChainStorerStub{},
BlockChain: blockChain,
ShardCoordinator: &mock.ShardCoordinatorStub{},
Marshalizer: marshalizer,
Uint64Converter: &mock.Uint64ByteSliceConverterMock{},
NFTStorageHandler: &testscommon.SimpleNFTStorageHandlerStub{},
BuiltInFunctions: builtInFuncs,
DataPool: testDataPool,
CompiledSCPool: testDataPool.SmartContracts(),
EpochNotifier: &epochNotifier.EpochNotifierStub{},
NilCompiledSCStore: true,
Accounts: userAccountsDB,
PubkeyConv: &mock.PubkeyConverterMock{},
StorageService: &mock.ChainStorerStub{},
BlockChain: blockChain,
ShardCoordinator: &mock.ShardCoordinatorStub{},
Marshalizer: marshalizer,
Uint64Converter: &mock.Uint64ByteSliceConverterMock{},
NFTStorageHandler: &testscommon.SimpleNFTStorageHandlerStub{},
BuiltInFunctions: builtInFuncs,
DataPool: testDataPool,
GlobalSettingsHandler: &testscommon.ESDTGlobalSettingsHandlerStub{},
CompiledSCPool: testDataPool.SmartContracts(),
EpochNotifier: &epochNotifier.EpochNotifierStub{},
NilCompiledSCStore: true,
}

defaults.FillGasMapInternal(gasSchedule, 1)
Expand Down