From 5a5baf571d87599d0cd99fd62cf74d8198c8ec3c Mon Sep 17 00:00:00 2001 From: dhrubabasu <7675102+dhrubabasu@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:31:50 -0700 Subject: [PATCH 1/2] [vms/platformvm] Minor grammer fixes in `state` struct code comments --- vms/platformvm/state/state.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/vms/platformvm/state/state.go b/vms/platformvm/state/state.go index 295e67c52ff3..05c815ed62bf 100644 --- a/vms/platformvm/state/state.go +++ b/vms/platformvm/state/state.go @@ -288,11 +288,11 @@ type state struct { currentHeight uint64 addedBlockIDs map[uint64]ids.ID // map of height -> blockID - blockIDCache cache.Cacher[uint64, ids.ID] // cache of height -> blockID. If the entry is ids.Empty, it is not in the database + blockIDCache cache.Cacher[uint64, ids.ID] // cache of height -> blockID; if the entry is ids.Empty, it is not in the database blockIDDB database.Database addedBlocks map[ids.ID]block.Block // map of blockID -> Block - blockCache cache.Cacher[ids.ID, block.Block] // cache of blockID -> Block. If the entry is nil, it is not in the database + blockCache cache.Cacher[ids.ID, block.Block] // cache of blockID -> Block; if the entry is nil, it is not in the database blockDB database.Database validatorsDB database.Database @@ -319,14 +319,14 @@ type state struct { validatorPublicKeyDiffsDB database.Database addedTxs map[ids.ID]*txAndStatus // map of txID -> {*txs.Tx, Status} - txCache cache.Cacher[ids.ID, *txAndStatus] // txID -> {*txs.Tx, Status}. If the entry is nil, it isn't in the database + txCache cache.Cacher[ids.ID, *txAndStatus] // txID -> {*txs.Tx, Status}; if the entry is nil, it is not in the database txDB database.Database addedRewardUTXOs map[ids.ID][]*avax.UTXO // map of txID -> []*UTXO rewardUTXOsCache cache.Cacher[ids.ID, []*avax.UTXO] // txID -> []*UTXO rewardUTXODB database.Database - modifiedUTXOs map[ids.ID]*avax.UTXO // map of modified UTXOID -> *UTXO if the UTXO is nil, it has been removed + modifiedUTXOs map[ids.ID]*avax.UTXO // map of modified UTXOID -> *UTXO; if the UTXO is nil, it has been removed utxoDB database.Database utxoState avax.UTXOState @@ -335,17 +335,16 @@ type state struct { subnetBaseDB database.Database subnetDB linkeddb.LinkedDB - // Subnet ID --> Owner of the subnet - subnetOwners map[ids.ID]fx.Owner - subnetOwnerCache cache.Cacher[ids.ID, fxOwnerAndSize] // cache of subnetID -> owner if the entry is nil, it is not in the database + subnetOwners map[ids.ID]fx.Owner // map of subnetID -> owner + subnetOwnerCache cache.Cacher[ids.ID, fxOwnerAndSize] // cache of subnetID -> owner; if the entry is nil, it is not in the database subnetOwnerDB database.Database transformedSubnets map[ids.ID]*txs.Tx // map of subnetID -> transformSubnetTx - transformedSubnetCache cache.Cacher[ids.ID, *txs.Tx] // cache of subnetID -> transformSubnetTx if the entry is nil, it is not in the database + transformedSubnetCache cache.Cacher[ids.ID, *txs.Tx] // cache of subnetID -> transformSubnetTx; if the entry is nil, it is not in the database transformedSubnetDB database.Database modifiedSupplies map[ids.ID]uint64 // map of subnetID -> current supply - supplyCache cache.Cacher[ids.ID, *uint64] // cache of subnetID -> current supply if the entry is nil, it is not in the database + supplyCache cache.Cacher[ids.ID, *uint64] // cache of subnetID -> current supply; if the entry is nil, it is not in the database supplyDB database.Database addedChains map[ids.ID][]*txs.Tx // maps subnetID -> the newly added chains to the subnet @@ -1116,7 +1115,7 @@ func applyWeightDiff( ) error { vdr, ok := vdrs[nodeID] if !ok { - // This node isn't in the current validator set. + // This node is not in the current validator set. vdr = &validators.GetValidatorOutput{ NodeID: nodeID, } From 94440fef29be6bb293f6a2be71e69c51e9a8c99d Mon Sep 17 00:00:00 2001 From: dhrubabasu <7675102+dhrubabasu@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:34:18 -0700 Subject: [PATCH 2/2] reduce diff --- vms/platformvm/state/state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vms/platformvm/state/state.go b/vms/platformvm/state/state.go index 05c815ed62bf..2c090422e06d 100644 --- a/vms/platformvm/state/state.go +++ b/vms/platformvm/state/state.go @@ -1115,7 +1115,7 @@ func applyWeightDiff( ) error { vdr, ok := vdrs[nodeID] if !ok { - // This node is not in the current validator set. + // This node isn't in the current validator set. vdr = &validators.GetValidatorOutput{ NodeID: nodeID, }