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

Pchain Merkle DB #1742

Closed
wants to merge 256 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
cbd246b
fix insert after delete delegator in diff
abi87 Mar 30, 2023
e7691da
extended test coverage
abi87 Mar 30, 2023
94ecc46
nit
abi87 Mar 30, 2023
cf91599
nit
abi87 Mar 30, 2023
382148d
cleanup
abi87 Mar 30, 2023
8c119d5
wip: stakers storage stateful testing
abi87 Mar 30, 2023
0e48267
wip: more stakers storage stateful testing
abi87 Mar 30, 2023
3bead39
wip: more stakers storage stateful testing
abi87 Mar 31, 2023
f6356f2
wip: more stakers storage stateful testing
abi87 Mar 31, 2023
13c5256
merge fix
abi87 Apr 7, 2023
610b14d
Add BLS benchmarks (#1318)
StephenButtolph Apr 11, 2023
0c6064a
Encode codec version in merkledb (#1313)
Apr 11, 2023
ffc7e42
Expose consensus-app-concurrency (#1322)
StephenButtolph Apr 11, 2023
e8f6abe
Adjust Logic In Merkle DB History (#1310)
dboehm-avalabs Apr 11, 2023
343693f
Fix Concurrency Bug In CommitToParent (#1320)
dboehm-avalabs Apr 11, 2023
f8eb5c3
Cleanup goroutines on health.Stop (#1325)
StephenButtolph Apr 11, 2023
8441a3a
Update versions for v1.10.0 (#1282)
StephenButtolph Apr 11, 2023
6958914
Add benchmark for gRPC GetValidatorSet (#1326)
hexfusion Apr 12, 2023
a924b94
Add checks for database being closed in merkledb; other nits (#1333)
Apr 12, 2023
7d6fda1
nit
abi87 Apr 13, 2023
5a57560
Merge branch 'dev' into stakers_model
abi87 Apr 17, 2023
4be61bb
Merge branch 'dev' into stakers_model
abi87 Apr 20, 2023
45cab8a
Merge branch 'dev' into stakers_model
abi87 Apr 21, 2023
4173c34
Merge branch 'dev' into stakers_model
abi87 Apr 24, 2023
fbd5048
Merge branch 'dev' into stakers_model
abi87 Apr 26, 2023
b3a2fad
Merge branch 'dev' into stakers_model
abi87 May 1, 2023
d6a65e6
Merge branch 'dev' into stakers_model
abi87 May 2, 2023
1f32388
Merge branch 'dev' into stakers_model
abi87 May 3, 2023
30ac9cb
Merge branch 'dev' into stakers_model
abi87 May 4, 2023
cd5cd2b
Merge branch 'dev' into stakers_model
abi87 May 10, 2023
adc5f40
docs
abi87 May 10, 2023
ab56c7f
nit
abi87 May 11, 2023
643e3b2
nits
abi87 May 11, 2023
9c4fa9a
cleanup
abi87 May 11, 2023
c47b72a
Merge branch 'dev' into stakers_model
abi87 May 16, 2023
06bbc5d
Merge branch 'dev' into stakers_model
abi87 May 17, 2023
be9a042
Merge branch 'dev' into stakers_model
abi87 May 18, 2023
273cab4
nit
abi87 May 18, 2023
2acb7ef
Merge branch 'dev' into stakers_model
abi87 May 18, 2023
8030940
Merge branch 'dev' into stakers_model
abi87 May 19, 2023
ff98262
Merge branch 'dev' into stakers_model
abi87 May 20, 2023
68dd0f5
Merge branch 'dev' into stakers_model
abi87 May 23, 2023
c63f3b5
Merge branch 'dev' into stakers_model
abi87 May 24, 2023
1e104db
nits
abi87 May 24, 2023
d6d0a83
nits
abi87 May 24, 2023
e8ad209
reduced code duplication in UTs
abi87 May 24, 2023
7ef586d
nits
abi87 May 24, 2023
7c69f5e
Merge branch 'dev' into stakers_model
abi87 May 25, 2023
42bf741
Merge branch 'dev' into stakers_model
abi87 May 28, 2023
b50c595
Merge branch 'dev' into stakers_model
abi87 May 31, 2023
1229d7c
Merge branch 'dev' into stakers_model
abi87 May 31, 2023
8f7d5b2
Merge branch 'dev' into stakers_model
abi87 Jun 1, 2023
33b7dd9
UT nit
abi87 Jun 1, 2023
340b25c
Merge branch 'dev' into stakers_model
abi87 Jun 6, 2023
2a57245
Merge branch 'dev' into stakers_model
abi87 Jun 8, 2023
40719d9
Merge branch 'dev' into stakers_model
abi87 Jun 9, 2023
054a4d2
Merge branch 'dev' into stakers_model
abi87 Jun 11, 2023
92db303
Merge branch 'dev' into stakers_model
abi87 Jun 13, 2023
5725cbc
Merge branch 'dev' into stakers_model
abi87 Jun 13, 2023
e2f4922
Merge branch 'dev' into stakers_model
abi87 Jun 13, 2023
6604f38
Merge branch 'dev' into stakers_model
abi87 Jun 14, 2023
c5941a8
appease linter
abi87 Jun 14, 2023
99041e5
Merge branch 'dev' into stakers_model
abi87 Jun 15, 2023
c47f410
Merge branch 'dev' into stakers_model
abi87 Jun 15, 2023
b6b8e9f
Merge branch 'dev' into stakers_model
abi87 Jun 16, 2023
8177cd0
Merge branch 'dev' into stakers_model
abi87 Jun 19, 2023
59de7f1
nit
abi87 Jun 19, 2023
73a8117
nit
abi87 Jun 19, 2023
6253862
Merge branch 'dev' into stakers_model
abi87 Jun 19, 2023
5fbeab9
nits
abi87 Jun 19, 2023
628b5c6
wip: restructuring stakers generators
abi87 Jun 20, 2023
07fdd6f
Merge branch 'dev' into stakers_model
abi87 Jun 28, 2023
564098a
nits
abi87 Jun 28, 2023
4ed0ec6
extended property tests with state rebuild checks
abi87 Jun 28, 2023
79f78c2
nits
abi87 Jun 28, 2023
e28dc21
Merge branch 'dev' into stakers_model
abi87 Jun 28, 2023
93eb13e
Merge branch 'dev' into stakers_model
abi87 Jun 29, 2023
157bc5f
Merge branch 'dev' into stakers_model
abi87 Jun 30, 2023
8ff47f5
Merge branch 'dev' into stakers_model
abi87 Jul 3, 2023
afb6296
skewed stakers property tests towards primary network + more fixes
abi87 Jul 5, 2023
f3281bc
fixed storage ops
abi87 Jul 6, 2023
4929d31
nit
abi87 Jul 6, 2023
52319b2
Merge branch 'dev' into stakers_model
abi87 Jul 6, 2023
1a136c5
nits
abi87 Jul 6, 2023
c220b51
fixed UTs data race
abi87 Jul 6, 2023
8fcfb76
nit
abi87 Jul 7, 2023
940dbe3
Merge branch 'dev' into stakers_model
abi87 Jul 7, 2023
1c5de0c
Merge branch 'dev' into stakers_model
abi87 Jul 10, 2023
44ed635
Merge branch 'dev' into stakers_model
abi87 Jul 10, 2023
62ab0b5
Merge branch 'dev' into stakers_model
abi87 Jul 11, 2023
90bbe95
Merge branch 'dev' into stakers_model
abi87 Jul 13, 2023
6ac3131
Merge branch 'dev' into stakers_model
abi87 Jul 14, 2023
bae62c9
Merge branch 'dev' into stakers_model
abi87 Jul 19, 2023
9a3e581
Merge branch 'dev' into stakers_model
abi87 Jul 20, 2023
d681698
wip: creating pchain state based on merkleDB
abi87 Jul 20, 2023
be24571
wip: merkleDB pchain state
abi87 Jul 20, 2023
e2fbc07
wip: merkleDB pchain state
abi87 Jul 20, 2023
6642d17
wip: merkleDB pchain state
abi87 Jul 20, 2023
d5177d9
Merge branch 'dev' into stakers_model
abi87 Jul 21, 2023
8c37259
wip: scaffolding and cleanup
abi87 Jul 21, 2023
eabc916
wip: some more work on merkleDB
abi87 Jul 21, 2023
ab0b712
wip: some more work on merkleDB
abi87 Jul 21, 2023
dffd68d
wip: coded sync genesis
abi87 Jul 21, 2023
95037b5
wip: load up data from disk
abi87 Jul 21, 2023
df5bbd1
wip: hooked up merkleDB. Fixing bugs
abi87 Jul 22, 2023
554d42f
wip: some more bug fixing
abi87 Jul 22, 2023
d07531d
nit
abi87 Jul 22, 2023
f006058
Merge branch 'dev' into stakers_model
abi87 Jul 22, 2023
b43061c
wip: some more fixes
abi87 Jul 22, 2023
46d9952
wip: some more fixes
abi87 Jul 22, 2023
669ad93
wip: some more fixes
abi87 Jul 22, 2023
cc22caa
wip: some more fixes
abi87 Jul 22, 2023
c2118a3
wip: replaced state.state with merkleState
abi87 Jul 22, 2023
b24702e
some more fixes
abi87 Jul 23, 2023
a03c91b
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Jul 23, 2023
94e413b
fix panic
abi87 Jul 23, 2023
76d09a3
nits
abi87 Jul 23, 2023
0edc2f4
wip: fixed ginko tests
abi87 Jul 23, 2023
ddb8cdb
Merge branch 'dev' into stakers_model
abi87 Jul 24, 2023
ee0e13f
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Jul 24, 2023
b7e84b9
completed UTs rotation from state.state to state.merklestate
abi87 Jul 24, 2023
1e846f1
Merge branch 'pchain_merkleDB' of github.com:ava-labs/avalanchego int…
abi87 Jul 24, 2023
55587c8
Merge branch 'dev' into stakers_model
abi87 Jul 25, 2023
61cf530
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Jul 25, 2023
c85f8c1
Merge branch 'dev' into stakers_model
abi87 Jul 26, 2023
c916ef1
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Jul 26, 2023
aa5e002
Merge branch 'dev' into stakers_model
abi87 Jul 27, 2023
744645c
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Jul 27, 2023
10ac9cb
Merge branch 'dev' into stakers_model
abi87 Jul 28, 2023
e000c89
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Jul 28, 2023
4a8d459
Merge branch 'dev' into stakers_model
abi87 Aug 7, 2023
f3a9949
Merge branch 'dev' into stakers_model
abi87 Aug 9, 2023
122ae78
Merge branch 'dev' into stakers_model
abi87 Aug 11, 2023
cf49870
Merge branch 'dev' into stakers_model
abi87 Aug 14, 2023
9f38091
Merge branch 'dev' into stakers_model
abi87 Aug 16, 2023
87abc10
dropped unreachable code
abi87 Aug 16, 2023
5ad376f
Merge branch 'dev' into stakers_model
abi87 Aug 21, 2023
adac490
Merge branch 'dev' into stakers_model
abi87 Aug 22, 2023
b0fc46d
Merge branch 'dev' into stakers_model
abi87 Aug 24, 2023
65258ed
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Aug 24, 2023
12cc862
leftover from merge
abi87 Aug 25, 2023
00d63f9
Merge branch 'dev' into stakers_model
abi87 Aug 25, 2023
820b3d8
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Aug 25, 2023
3616ab7
nits
abi87 Aug 25, 2023
fdc5da7
Merge branch 'pchain_merkleDB' of github.com:ava-labs/avalanchego int…
abi87 Aug 25, 2023
c9db860
fixed metrics
abi87 Aug 25, 2023
aec5b59
added merkleDB root logging
abi87 Aug 25, 2023
920ab8c
nit
abi87 Aug 26, 2023
24aa9ca
Merge branch 'dev' into stakers_model
abi87 Aug 29, 2023
ccffef8
nits to improve merkleDB commit logging
abi87 Aug 30, 2023
415b34d
avoid genesis double commit
abi87 Aug 30, 2023
fe720f6
Merge branch 'dev' into stakers_model
abi87 Aug 30, 2023
c1216ab
Merge branch 'dev' into stakers_model
abi87 Aug 31, 2023
79d1520
nit
abi87 Aug 31, 2023
eecf423
Merge branch 'dev' into stakers_model
abi87 Sep 4, 2023
c2c6bc4
Merge branch 'dev' into stakers_model
abi87 Sep 6, 2023
2b1f22d
Merge branch 'stakers_model' into pchain_merkleDB
abi87 Sep 6, 2023
ae79f52
Merge branch 'dev' into stakers_model
abi87 Sep 11, 2023
599ebaa
Merge branch 'dev' into stakers_model
abi87 Sep 12, 2023
7cd0606
appease linter
abi87 Sep 14, 2023
fd32154
Merge branch 'dev' into stakers_model
abi87 Sep 14, 2023
b5fa9a3
Merge branch 'dev' into stakers_model
abi87 Sep 18, 2023
3cbf840
Merge branch 'dev' into stakers_model
abi87 Sep 20, 2023
31c680a
Merge branch 'dev' into stakers_model
abi87 Sep 21, 2023
2f43c45
Merge branch 'dev' into stakers_model
abi87 Sep 29, 2023
84669e6
Merge branch 'dev' into stakers_model
abi87 Oct 4, 2023
e4d9f04
Merge branch 'dev' into stakers_model
abi87 Oct 6, 2023
0300469
Merge branch 'dev' into stakers_model
abi87 Oct 11, 2023
10f6c52
Merge branch 'dev' into stakers_model
abi87 Oct 15, 2023
b4346f7
Merge branch 'dev' into stakers_model
abi87 Oct 17, 2023
d57e692
Merge branch 'dev' into stakers_model
abi87 Oct 17, 2023
460046e
Merge branch 'dev' into stakers_model
abi87 Oct 18, 2023
a193dc3
lower cache sizes from 2 GiB to 512 MiB
Oct 24, 2023
59bc033
fix append
Oct 24, 2023
0448de9
getTXs --> getTxs
Oct 24, 2023
c232113
remove merkleUtxoIndexPrefix
Oct 24, 2023
04b6348
typo fix; cleanup context
Oct 24, 2023
6a22584
reduce allocations
Oct 24, 2023
2cac774
Merge branch 'dev' into stakers_model
abi87 Oct 25, 2023
801e2ea
fixed merge
abi87 Oct 25, 2023
b5abd4e
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Oct 27, 2023
2255c6e
Merge remote-tracking branch 'upstream/dev' into stakers_model
Oct 27, 2023
cb00bd4
Merge branch 'stakers_model' into pchain_merkleDB
Oct 27, 2023
98fed7b
appease linter
Oct 27, 2023
50bd0a5
fix getSubnetOwners
Oct 27, 2023
926ef62
appease linter
Oct 27, 2023
050d6bb
remove unneeded copy
Oct 27, 2023
a0f8e12
bump timeout
Oct 27, 2023
25d6887
moved reward UTXOs out of merkleDB section
abi87 Oct 27, 2023
8ee5c69
Merge branch 'pchain_merkleDB' of github.com:ava-labs/avalanchego int…
abi87 Oct 27, 2023
a15e900
Merge branch 'dev' into pchain_merkleDB
abi87 Oct 30, 2023
6e5c8aa
used utils.Err
abi87 Oct 30, 2023
1ee4919
Merge branch 'dev' into pchain_merkleDB
abi87 Nov 6, 2023
170cfb4
rebased on dev
abi87 Nov 6, 2023
6aabe03
Merge branch 'dev' into pchain_merkleDB
Nov 15, 2023
30cb24a
comments; typos
Nov 15, 2023
f48fbfe
re-order field setting in newMerkleState to be in same order as decla…
Nov 15, 2023
6ab428a
add comments
Nov 15, 2023
2f9dd38
comment nits
Nov 15, 2023
4fddb3a
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 16, 2023
0b356f1
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 16, 2023
2359675
nit
Nov 16, 2023
2732b43
Merge remote-tracking branch 'upstream/dev' into pchain_merkledb
Nov 16, 2023
3b831c1
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 17, 2023
7805fb5
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 17, 2023
acbca04
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 20, 2023
308f59b
fix merge
Nov 20, 2023
60e7229
replaced state.State with state.MerkleState
abi87 Nov 22, 2023
e978828
nits
abi87 Nov 22, 2023
4663aa4
leftover nit
abi87 Nov 22, 2023
c482bab
Merge branch 'dev' into pchain_merkleDB
abi87 Nov 22, 2023
11371c9
nit
abi87 Nov 24, 2023
2fa942d
Merge branch 'dev' into pchain_merkleDB
abi87 Nov 24, 2023
3a69cb1
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 28, 2023
cc7111e
fix imports; move var declaration
Nov 28, 2023
764c24f
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 28, 2023
1161e11
[WIP] P-Chain merkle DB -- smaller diff (#2382)
Nov 29, 2023
bd0e37d
Merge branch 'dev' into pchain_merkleDB
Nov 29, 2023
f01c1ef
Merge branch 'dev' into pchain_merkleDB
Nov 29, 2023
69c44e0
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 29, 2023
07b3cdb
nit naming
Nov 29, 2023
0ab0c29
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Nov 30, 2023
3ea16e1
P-Chain merkledb -- remove caches (#2392)
Dec 1, 2023
02c5267
P-Chain merkledb -- don't merkleize last accepted block ID (#2397)
Dec 1, 2023
4aea9e0
Merge branch 'dev' into pchain_merkleDB
Dec 1, 2023
093647c
[WIP] Add ability to get merkle root of P-Chain state (#2352)
Dec 1, 2023
0b875ab
P-Chain merkledb -- include txs in merkleized state (#2398)
Dec 5, 2023
8dd4663
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Dec 12, 2023
a743226
nit
Dec 12, 2023
ddb34e3
remove unneeded var
Dec 12, 2023
798debf
nit
Dec 12, 2023
1357e38
update comments
Dec 12, 2023
6bce2f1
remove unused code
Dec 12, 2023
9637244
nits
Dec 12, 2023
c27f793
nit
Dec 12, 2023
9bb088e
appease linter; add missing reference
Dec 12, 2023
1b5d590
remove dead code
Dec 12, 2023
35be4bb
comment
Dec 12, 2023
b6e52fb
nits
Dec 12, 2023
f552616
rename uptimes to uptimeMetadata
Dec 12, 2023
346eba9
rename stakersData to stakingTxAndReward
Dec 12, 2023
2f0e530
add missing reference
Dec 12, 2023
a90dc07
Merge remote-tracking branch 'upstream/dev' into pchain_merkleDB
Dec 12, 2023
57a2719
naming nits; fix test
Dec 12, 2023
cc95bb6
reduced diff from dev
abi87 Dec 19, 2023
48ac596
Merge branch 'dev' into pchain_merkleDB
abi87 Dec 19, 2023
0e933d9
wip: fixing merge
abi87 Dec 20, 2023
79f8dda
Merge branch 'dev' into pchain_merkleDB
abi87 Jan 4, 2024
0469083
added regression test
abi87 Jan 4, 2024
639f1bd
Merge branch 'dev' into pchain_merkleDB
Jan 5, 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
Prev Previous commit
Next Next commit
rename uptimes to uptimeMetadata
Dan Laine committed Dec 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit f552616c2c5944cef224f341d504c1168010d430
10 changes: 5 additions & 5 deletions vms/platformvm/state/state.go
Original file line number Diff line number Diff line change
@@ -281,7 +281,7 @@ type state struct {
indexedUTXOsDB database.Database

// Node ID --> SubnetID --> Uptime of the node on the subnet
modifiedLocalUptimes map[ids.NodeID]map[ids.ID]*uptimes
modifiedLocalUptimes map[ids.NodeID]map[ids.ID]*uptimeMetadata
localUptimesDB database.Database

flatValidatorWeightDiffsDB database.Database
@@ -426,7 +426,7 @@ func newState(

indexedUTXOsDB: indexedUTXOsDB,

modifiedLocalUptimes: make(map[ids.NodeID]map[ids.ID]*uptimes),
modifiedLocalUptimes: make(map[ids.NodeID]map[ids.ID]*uptimeMetadata),
localUptimesDB: localUptimesDB,

flatValidatorWeightDiffsDB: flatValidatorWeightDiffsDB,
@@ -1950,7 +1950,7 @@ func (s *state) GetUptime(vdrID ids.NodeID, subnetID ids.ID) (upDuration time.Du
uptimeBytes, err := s.localUptimesDB.Get(key)
switch err {
case nil:
var uptime uptimes
var uptime uptimeMetadata
if _, err := txs.GenesisCodec.Unmarshal(uptimeBytes, &uptime); err != nil {
return 0, time.Time{}, err
}
@@ -1967,10 +1967,10 @@ func (s *state) GetUptime(vdrID ids.NodeID, subnetID ids.ID) (upDuration time.Du
func (s *state) SetUptime(vdrID ids.NodeID, subnetID ids.ID, upDuration time.Duration, lastUpdated time.Time) error {
updatedNodeUptimes, ok := s.modifiedLocalUptimes[vdrID]
if !ok {
updatedNodeUptimes = make(map[ids.ID]*uptimes, 0)
updatedNodeUptimes = make(map[ids.ID]*uptimeMetadata, 0)
s.modifiedLocalUptimes[vdrID] = updatedNodeUptimes
}
updatedNodeUptimes[subnetID] = &uptimes{
updatedNodeUptimes[subnetID] = &uptimeMetadata{
Duration: upDuration,
LastUpdated: uint64(lastUpdated.Unix()),
lastUpdated: lastUpdated,
3 changes: 1 addition & 2 deletions vms/platformvm/state/state_helpers.go
Original file line number Diff line number Diff line change
@@ -9,8 +9,7 @@ import (
"github.com/ava-labs/avalanchego/ids"
)

// helpers types to store data on merkleDB
type uptimes struct {
type uptimeMetadata struct {
Duration time.Duration `serialize:"true"`
LastUpdated uint64 `serialize:"true"` // Unix time in seconds