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

Rc/v1.6.next1 #5945

Merged
merged 93 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
a189c1d
Sandbox for vm queries.
andreibancioiu Jan 4, 2024
92323bf
Recreate trie from epoch.
andreibancioiu Jan 4, 2024
94f6572
Fix epoch.
andreibancioiu Jan 4, 2024
8975f79
- added a critical section in the trie nodes resolvers and a differen…
iulianpascalau Jan 31, 2024
94a2d47
- fixes
iulianpascalau Feb 6, 2024
6865acb
Merge branch 'master' into sandbox-queries
andreibancioiu Feb 6, 2024
f31383f
- more fixes
iulianpascalau Feb 6, 2024
26621d2
Merge remote-tracking branch 'origin/sandbox-queries' into sandbox-qu…
iulianpascalau Feb 6, 2024
a6b9d47
Add integration test for deep queries.
andreibancioiu Feb 8, 2024
680321c
new VM 1.5.27
sasurobert Feb 9, 2024
9de76e0
fix scripts for local testnet in multikey mode
sstanculeanu Feb 9, 2024
2574f71
Merge pull request #5935 from multiversx/deep-query-test-01
iulianpascalau Feb 9, 2024
73dfdcf
- removed unnecessary heartbeat components
iulianpascalau Feb 9, 2024
0710ad5
new route /node/loaded-keys
sstanculeanu Feb 9, 2024
fed1b07
Merge branch 'rc/v1.6.next1' into trie-resolvers-critical-section
iulianpascalau Feb 12, 2024
28cbb9f
fix after review, return the main public key while in single key mode
sstanculeanu Feb 12, 2024
d2a027b
Merge pull request #5940 from multiversx/fix_local_testnets_scripts_m…
sstanculeanu Feb 12, 2024
ebeaab4
Merge branch 'rc/v1.6.next1' into loaded-keys
sstanculeanu Feb 12, 2024
8e483ac
- fixed the p2p configs
iulianpascalau Feb 12, 2024
6a4f66a
- fixes after review
iulianpascalau Feb 12, 2024
59235a2
Merge branch 'master' into merge-master-rc-v1.6.nex1-2024.02.12
iulianpascalau Feb 12, 2024
2f172f6
Merge branch 'rc/v1.6.next1' into fix-low-intra-shard-peers-counters
iulianpascalau Feb 13, 2024
0bba37f
Merge branch 'rc/v1.6.next1' into trie-resolvers-critical-section
iulianpascalau Feb 13, 2024
9c4a906
Merge pull request #5950 from multiversx/merge-master-rc-v1.6.next1-2…
gabi-vuls Feb 13, 2024
6dd4a1b
Merge branch 'rc/v1.6.next1' into fix-low-intra-shard-peers-counters
gabi-vuls Feb 13, 2024
50937b8
Attempt fix for deep queries on metachain.
andreibancioiu Feb 13, 2024
143e5d6
Merge branch 'rc/v1.6.next1' into fix-p2p-configs
iulianpascalau Feb 13, 2024
0630e26
Fix after review.
andreibancioiu Feb 13, 2024
a5c3bca
Merge branch 'rc/v1.6.next1' into loaded-keys
gabi-vuls Feb 13, 2024
2e255a3
Undo changed within one node network.
andreibancioiu Feb 13, 2024
dc797c7
Merge branch 'rc/v1.6.next1' into sandbox-queries
gabi-vuls Feb 13, 2024
452bf4b
Merge pull request #5943 from multiversx/loaded-keys
gabi-vuls Feb 13, 2024
bcfe253
Merge branch 'rc/v1.6.next1' into fix-p2p-configs
gabi-vuls Feb 13, 2024
34e2f28
Merge pull request #5947 from multiversx/fix-p2p-configs
gabi-vuls Feb 13, 2024
20eab64
Add integration test.
andreibancioiu Feb 13, 2024
752b58a
Add unit test.
andreibancioiu Feb 13, 2024
7eac8b7
Add some comments.
andreibancioiu Feb 13, 2024
9415ae4
Merge branch 'rc/v1.6.next1' into fix-low-intra-shard-peers-counters
iulianpascalau Feb 14, 2024
8019dec
Merge pull request #5958 from multiversx/deep-query-metachain
iulianpascalau Feb 14, 2024
83f496b
Merge branch 'rc/v1.6.next1' into sandbox-queries
iulianpascalau Feb 14, 2024
1dfc18f
Merge branch 'rc/v1.6.next1' into trie-resolvers-critical-section
gabi-vuls Feb 14, 2024
b5be263
Merge pull request #5899 from multiversx/trie-resolvers-critical-section
gabi-vuls Feb 14, 2024
420251b
Merge branch 'rc/v1.6.next1' into fix-low-intra-shard-peers-counters
iulianpascalau Feb 14, 2024
6d62be0
Add test for "transferValueOnly" (async call and back transfer).
andreibancioiu Feb 14, 2024
c0ffb89
Merge branch 'rc/v1.6.next1' into extra-tests-transfer-value
andreibancioiu Feb 14, 2024
828721b
Fix after self review.
andreibancioiu Feb 14, 2024
54869fa
Merge branch 'rc/v1.6.next1' into sandbox-queries
iulianpascalau Feb 14, 2024
41c121c
Fix after review.
andreibancioiu Feb 14, 2024
a440974
Merge branch 'extra-tests-transfer-value' of github.com:multiversx/mx…
andreibancioiu Feb 14, 2024
5a3ec4d
- fixed linter issues
iulianpascalau Feb 14, 2024
b5dcb4f
Merge pull request #5942 from multiversx/fix-low-intra-shard-peers-co…
gabi-vuls Feb 14, 2024
d7339ec
Merge branch 'rc/v1.6.next1' into sandbox-queries
gabi-vuls Feb 14, 2024
eeaa9a7
Merge branch 'rc/v1.6.next1' into vm1.5.27-deduplicate-logs
gabi-vuls Feb 14, 2024
acef8ff
Fix contract to test for duplicated events.
andreibancioiu Feb 15, 2024
fa959a6
Make test fail (should work after merging #5936).
andreibancioiu Feb 15, 2024
62f6edc
Merge branch 'rc/v1.6.next1' into extra-tests-transfer-value
andreibancioiu Feb 15, 2024
866fa2a
vm1.5.27
sasurobert Feb 15, 2024
0f58ade
vm1.5.27
sasurobert Feb 15, 2024
3daf0f9
vm1.5.27
sasurobert Feb 15, 2024
f79b2d4
vm1.5.27
sasurobert Feb 15, 2024
91079ba
Merge pull request #5936 from multiversx/vm1.5.27-deduplicate-logs
gabi-vuls Feb 15, 2024
93afe39
Merge branch 'rc/v1.6.next1' into extra-tests-transfer-value
iulianpascalau Feb 15, 2024
5531e7f
Merge pull request #5963 from multiversx/extra-tests-transfer-value
iulianpascalau Feb 15, 2024
624413b
Merge branch 'rc/v1.6.next1' into sandbox-queries
iulianpascalau Feb 15, 2024
6faf35a
Merge pull request #5801 from multiversx/sandbox-queries
iulianpascalau Feb 15, 2024
c8e3b6d
Integrate VM branches with shim for wasmer 1.
andreibancioiu Feb 16, 2024
d553a93
Fix reference.
andreibancioiu Feb 16, 2024
a6aa80b
Do not create older VMs.
andreibancioiu Feb 17, 2024
22e0cd2
Remove legacy checks. Add extra logs.
andreibancioiu Feb 17, 2024
3e3aed0
Separate logs.
andreibancioiu Feb 17, 2024
3fcb27e
Merge branch 'rc/v1.6.next1' into vm-query-logs
andreibancioiu Feb 17, 2024
abfecd3
Undo changes.
andreibancioiu Feb 17, 2024
13bc2e4
Omit re-create if possible.
andreibancioiu Feb 20, 2024
6be2c90
- fixed recreate trie in sc query service
iulianpascalau Feb 20, 2024
b9ecacf
- fixes
iulianpascalau Feb 20, 2024
9f3d010
- fixes after review
iulianpascalau Feb 20, 2024
a929406
Merge pull request #5983 from multiversx/fix-recreate-trie-in-sc-quer…
andreibancioiu Feb 20, 2024
8e7be72
Fix after review.
andreibancioiu Feb 20, 2024
f9bcc00
Fix logs.
andreibancioiu Feb 20, 2024
688b8ff
Merge pull request #5977 from multiversx/vm-query-logs
iulianpascalau Feb 23, 2024
707530b
Remember latest queried epoch.
andreibancioiu Mar 1, 2024
0bbe9df
Fix after review.
andreibancioiu Mar 1, 2024
e731ccb
Fix tests.
andreibancioiu Mar 1, 2024
211beab
Fix condition for RecreateTrie.
andreibancioiu Mar 1, 2024
952ccc8
- handled vm queries in snapshotless mode
iulianpascalau Mar 1, 2024
b39c59e
Merge branch 'vm-queries-remember-epoch' into vm-queries-remember-epo…
iulianpascalau Mar 1, 2024
d44648e
- fix after merge
iulianpascalau Mar 1, 2024
7959088
Merge pull request #6007 from multiversx/vm-queries-remember-epoch-sn…
andreibancioiu Mar 1, 2024
d867f82
- refactored solution
iulianpascalau Mar 1, 2024
ca68006
Merge pull request #6008 from multiversx/vm-queries-remember-epoch-re…
iulianpascalau Mar 4, 2024
f731d80
Merge pull request #6005 from multiversx/vm-queries-remember-epoch
iulianpascalau Mar 5, 2024
a8ce97c
- fixed linter issue
iulianpascalau Mar 13, 2024
935273d
Merge pull request #6043 from multiversx/fix-linter-issue-2024.03.13
iulianpascalau Mar 14, 2024
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
20 changes: 20 additions & 0 deletions api/groups/nodeGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
bootstrapStatusPath = "/bootstrapstatus"
connectedPeersRatingsPath = "/connected-peers-ratings"
managedKeys = "/managed-keys"
loadedKeys = "/loaded-keys"
managedKeysCount = "/managed-keys/count"
eligibleManagedKeys = "/managed-keys/eligible"
waitingManagedKeys = "/managed-keys/waiting"
Expand All @@ -43,6 +44,7 @@ type nodeFacadeHandler interface {
GetConnectedPeersRatingsOnMainNetwork() (string, error)
GetManagedKeysCount() int
GetManagedKeys() []string
GetLoadedKeys() []string
GetEligibleManagedKeys() ([]string, error)
GetWaitingManagedKeys() ([]string, error)
IsInterfaceNil() bool
Expand Down Expand Up @@ -127,6 +129,11 @@ func NewNodeGroup(facade nodeFacadeHandler) (*nodeGroup, error) {
Method: http.MethodGet,
Handler: ng.managedKeys,
},
{
Path: loadedKeys,
Method: http.MethodGet,
Handler: ng.loadedKeys,
},
{
Path: eligibleManagedKeys,
Method: http.MethodGet,
Expand Down Expand Up @@ -404,6 +411,19 @@ func (ng *nodeGroup) managedKeys(c *gin.Context) {
)
}

// loadedKeys returns all keys loaded by the current node
func (ng *nodeGroup) loadedKeys(c *gin.Context) {
keys := ng.getFacade().GetLoadedKeys()
c.JSON(
http.StatusOK,
shared.GenericAPIResponse{
Data: gin.H{"loadedKeys": keys},
Error: "",
Code: shared.ReturnCodeSuccess,
},
)
}

// managedKeysEligible returns the node's eligible managed keys
func (ng *nodeGroup) managedKeysEligible(c *gin.Context) {
keys, err := ng.getFacade().GetEligibleManagedKeys()
Expand Down
38 changes: 38 additions & 0 deletions api/groups/nodeGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ type managedKeysResponse struct {
generalResponse
}

type loadedKeysResponse struct {
Data struct {
LoadedKeys []string `json:"loadedKeys"`
} `json:"data"`
generalResponse
}

type managedEligibleKeysResponse struct {
Data struct {
Keys []string `json:"eligibleKeys"`
Expand Down Expand Up @@ -733,6 +740,36 @@ func TestNodeGroup_ManagedKeys(t *testing.T) {
assert.Equal(t, providedKeys, response.Data.ManagedKeys)
}

func TestNodeGroup_LoadedKeys(t *testing.T) {
t.Parallel()

providedKeys := []string{
"pk1",
"pk2",
}
facade := mock.FacadeStub{
GetLoadedKeysCalled: func() []string {
return providedKeys
},
}

nodeGroup, err := groups.NewNodeGroup(&facade)
require.NoError(t, err)

ws := startWebServer(nodeGroup, "node", getNodeRoutesConfig())

req, _ := http.NewRequest("GET", "/node/loaded-keys", nil)
resp := httptest.NewRecorder()
ws.ServeHTTP(resp, req)

response := &loadedKeysResponse{}
loadResponse(resp.Body, response)

assert.Equal(t, http.StatusOK, resp.Code)
assert.Equal(t, "", response.Error)
assert.Equal(t, providedKeys, response.Data.LoadedKeys)
}

func TestNodeGroup_ManagedKeysEligible(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -960,6 +997,7 @@ func getNodeRoutesConfig() config.ApiRoutesConfig {
{Name: "/connected-peers-ratings", Open: true},
{Name: "/managed-keys/count", Open: true},
{Name: "/managed-keys", Open: true},
{Name: "/loaded-keys", Open: true},
{Name: "/managed-keys/eligible", Open: true},
{Name: "/managed-keys/waiting", Open: true},
},
Expand Down
9 changes: 9 additions & 0 deletions api/mock/facadeStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type FacadeStub struct {
IsDataTrieMigratedCalled func(address string, options api.AccountQueryOptions) (bool, error)
GetManagedKeysCountCalled func() int
GetManagedKeysCalled func() []string
GetLoadedKeysCalled func() []string
GetEligibleManagedKeysCalled func() ([]string, error)
GetWaitingManagedKeysCalled func() ([]string, error)
}
Expand Down Expand Up @@ -594,6 +595,14 @@ func (f *FacadeStub) GetManagedKeys() []string {
return make([]string, 0)
}

// GetLoadedKeys -
func (f *FacadeStub) GetLoadedKeys() []string {
if f.GetLoadedKeysCalled != nil {
return f.GetLoadedKeysCalled()
}
return make([]string, 0)
}

// GetEligibleManagedKeys -
func (f *FacadeStub) GetEligibleManagedKeys() ([]string, error) {
if f.GetEligibleManagedKeysCalled != nil {
Expand Down
1 change: 1 addition & 0 deletions api/shared/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ type FacadeHandler interface {
IsDataTrieMigrated(address string, options api.AccountQueryOptions) (bool, error)
GetManagedKeysCount() int
GetManagedKeys() []string
GetLoadedKeys() []string
GetEligibleManagedKeys() ([]string, error)
GetWaitingManagedKeys() ([]string, error)
IsInterfaceNil() bool
Expand Down
3 changes: 3 additions & 0 deletions cmd/node/config/api.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
# /node/managed-keys will return the keys managed by the node
{ Name = "/managed-keys", Open = true },

# /node/loaded-keys will return the keys loaded by the node
{ Name = "/loaded-keys", Open = true },

# /node/managed-keys/count will return the number of keys managed by the node
{ Name = "/managed-keys/count", Open = true },

Expand Down
1 change: 1 addition & 0 deletions cmd/node/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@
[Antiflood]
Enabled = true
NumConcurrentResolverJobs = 50
NumConcurrentResolvingTrieNodesJobs = 3
[Antiflood.FastReacting]
IntervalInSeconds = 1
ReservedPercent = 20.0
Expand Down
9 changes: 5 additions & 4 deletions cmd/node/config/fullArchiveP2P.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
[Node.Transports.TCP]
ListenAddress = "/ip4/0.0.0.0/tcp/%d" # TCP listen address
PreventPortReuse = false
[Node.ResourceLimiter]
Type = "default autoscale" #available options "default autoscale", "infinite", "default with manual scale".
ManualSystemMemoryInMB = 0 # not taken into account if the type is not "default with manual scale"
ManualMaximumFD = 0 # not taken into account if the type is not "default with manual scale"

[Node.ResourceLimiter]
Type = "default autoscale" #available options "default autoscale", "infinite", "default with manual scale".
ManualSystemMemoryInMB = 0 # not taken into account if the type is not "default with manual scale"
ManualMaximumFD = 0 # not taken into account if the type is not "default with manual scale"

# P2P peer discovery section

Expand Down
9 changes: 5 additions & 4 deletions cmd/node/config/p2p.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
[Node.Transports.TCP]
ListenAddress = "/ip4/0.0.0.0/tcp/%d" # TCP listen address
PreventPortReuse = false
[Node.ResourceLimiter]
Type = "default autoscale" #available options "default autoscale", "infinite", "default with manual scale".
ManualSystemMemoryInMB = 0 # not taken into account if the type is not "default with manual scale"
ManualMaximumFD = 0 # not taken into account if the type is not "default with manual scale"

[Node.ResourceLimiter]
Type = "default autoscale" #available options "default autoscale", "infinite", "default with manual scale".
ManualSystemMemoryInMB = 0 # not taken into account if the type is not "default with manual scale"
ManualMaximumFD = 0 # not taken into account if the type is not "default with manual scale"

# P2P peer discovery section

Expand Down
25 changes: 2 additions & 23 deletions cmd/node/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@ func applyCompatibleConfigs(log logger.Logger, configs *config.Configs) error {

isInHistoricalBalancesMode := operationmodes.SliceContainsElement(operationModes, operationmodes.OperationModeHistoricalBalances)
if isInHistoricalBalancesMode {
processHistoricalBalancesMode(log, configs)
// TODO move all operation modes settings in the common/operationmodes package and add tests
operationmodes.ProcessHistoricalBalancesMode(log, configs)
}

isInDbLookupExtensionMode := operationmodes.SliceContainsElement(operationModes, operationmodes.OperationModeDbLookupExtension)
Expand All @@ -648,28 +649,6 @@ func applyCompatibleConfigs(log logger.Logger, configs *config.Configs) error {
return nil
}

func processHistoricalBalancesMode(log logger.Logger, configs *config.Configs) {
configs.GeneralConfig.StoragePruning.Enabled = true
configs.GeneralConfig.StoragePruning.ValidatorCleanOldEpochsData = false
configs.GeneralConfig.StoragePruning.ObserverCleanOldEpochsData = false
configs.GeneralConfig.GeneralSettings.StartInEpochEnabled = false
configs.GeneralConfig.StoragePruning.AccountsTrieCleanOldEpochsData = false
configs.GeneralConfig.StateTriesConfig.AccountsStatePruningEnabled = false
configs.GeneralConfig.DbLookupExtensions.Enabled = true
configs.PreferencesConfig.Preferences.FullArchive = true

log.Warn("the node is in historical balances mode! Will auto-set some config values",
"StoragePruning.Enabled", configs.GeneralConfig.StoragePruning.Enabled,
"StoragePruning.ValidatorCleanOldEpochsData", configs.GeneralConfig.StoragePruning.ValidatorCleanOldEpochsData,
"StoragePruning.ObserverCleanOldEpochsData", configs.GeneralConfig.StoragePruning.ObserverCleanOldEpochsData,
"StoragePruning.AccountsTrieCleanOldEpochsData", configs.GeneralConfig.StoragePruning.AccountsTrieCleanOldEpochsData,
"GeneralSettings.StartInEpochEnabled", configs.GeneralConfig.GeneralSettings.StartInEpochEnabled,
"StateTriesConfig.AccountsStatePruningEnabled", configs.GeneralConfig.StateTriesConfig.AccountsStatePruningEnabled,
"DbLookupExtensions.Enabled", configs.GeneralConfig.DbLookupExtensions.Enabled,
"Preferences.FullArchive", configs.PreferencesConfig.Preferences.FullArchive,
)
}

func processDbLookupExtensionMode(log logger.Logger, configs *config.Configs) {
configs.GeneralConfig.DbLookupExtensions.Enabled = true
configs.GeneralConfig.StoragePruning.Enabled = true
Expand Down
9 changes: 5 additions & 4 deletions cmd/seednode/config/p2p.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
[Node.Transports.TCP]
ListenAddress = "/ip4/0.0.0.0/tcp/%d" # TCP listen address
PreventPortReuse = true # seeder nodes will need to enable this option
[Node.ResourceLimiter]
Type = "default with manual scale"
ManualSystemMemoryInMB = 65536 # pretend that the host running the seeder has more RAM so it can handle more connections
ManualMaximumFD = 1048576

[Node.ResourceLimiter]
Type = "default with manual scale"
ManualSystemMemoryInMB = 65536 # pretend that the host running the seeder has more RAM so it can handle more connections
ManualMaximumFD = 1048576

# P2P peer discovery section

Expand Down
2 changes: 2 additions & 0 deletions common/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ type ManagedPeersHolder interface {
IncrementRoundsWithoutReceivedMessages(pkBytes []byte)
ResetRoundsWithoutReceivedMessages(pkBytes []byte, pid core.PeerID)
GetManagedKeysByCurrentNode() map[string]crypto.PrivateKey
GetLoadedKeysByCurrentNode() [][]byte
IsKeyManagedByCurrentNode(pkBytes []byte) bool
IsKeyRegistered(pkBytes []byte) bool
IsPidManagedByCurrentNode(pid core.PeerID) bool
Expand Down Expand Up @@ -443,6 +444,7 @@ type StateSyncNotifierSubscriber interface {
type ManagedPeersMonitor interface {
GetManagedKeysCount() int
GetManagedKeys() [][]byte
GetLoadedKeys() [][]byte
GetEligibleManagedKeys() ([][]byte, error)
GetWaitingManagedKeys() ([][]byte, error)
IsInterfaceNil() bool
Expand Down
41 changes: 41 additions & 0 deletions common/operationmodes/historicalBalances.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package operationmodes

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

// ProcessHistoricalBalancesMode will process the provided flags for the historical balances
func ProcessHistoricalBalancesMode(log logger.Logger, configs *config.Configs) {
configs.GeneralConfig.StoragePruning.Enabled = true
configs.GeneralConfig.StoragePruning.ValidatorCleanOldEpochsData = false
configs.GeneralConfig.StoragePruning.ObserverCleanOldEpochsData = false
configs.GeneralConfig.GeneralSettings.StartInEpochEnabled = false
configs.GeneralConfig.StoragePruning.AccountsTrieCleanOldEpochsData = false
configs.GeneralConfig.StateTriesConfig.AccountsStatePruningEnabled = false
configs.GeneralConfig.DbLookupExtensions.Enabled = true
configs.PreferencesConfig.Preferences.FullArchive = true

log.Warn("the node is in historical balances mode! Will auto-set some config values",
"StoragePruning.Enabled", configs.GeneralConfig.StoragePruning.Enabled,
"StoragePruning.ValidatorCleanOldEpochsData", configs.GeneralConfig.StoragePruning.ValidatorCleanOldEpochsData,
"StoragePruning.ObserverCleanOldEpochsData", configs.GeneralConfig.StoragePruning.ObserverCleanOldEpochsData,
"StoragePruning.AccountsTrieCleanOldEpochsData", configs.GeneralConfig.StoragePruning.AccountsTrieCleanOldEpochsData,
"GeneralSettings.StartInEpochEnabled", configs.GeneralConfig.GeneralSettings.StartInEpochEnabled,
"StateTriesConfig.AccountsStatePruningEnabled", configs.GeneralConfig.StateTriesConfig.AccountsStatePruningEnabled,
"DbLookupExtensions.Enabled", configs.GeneralConfig.DbLookupExtensions.Enabled,
"Preferences.FullArchive", configs.PreferencesConfig.Preferences.FullArchive,
)
}

// IsInHistoricalBalancesMode returns true if the configuration provided denotes a historical balances mode
func IsInHistoricalBalancesMode(configs *config.Configs) bool {
return configs.GeneralConfig.StoragePruning.Enabled &&
!configs.GeneralConfig.StoragePruning.ValidatorCleanOldEpochsData &&
!configs.GeneralConfig.StoragePruning.ObserverCleanOldEpochsData &&
!configs.GeneralConfig.GeneralSettings.StartInEpochEnabled &&
!configs.GeneralConfig.StoragePruning.AccountsTrieCleanOldEpochsData &&
!configs.GeneralConfig.StateTriesConfig.AccountsStatePruningEnabled &&
configs.GeneralConfig.DbLookupExtensions.Enabled &&
configs.PreferencesConfig.Preferences.FullArchive
}
Loading
Loading