Skip to content

Commit

Permalink
resolve some of the TODOS
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Mar 6, 2024
1 parent a2a2b35 commit e44d623
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 17 deletions.
7 changes: 3 additions & 4 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1285,10 +1285,9 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
}
// If node is running in path mode, skip explicit gc operation
// which is unnecessary in this mode.
// XXX
// if bc.triedb.Scheme() == rawdb.PathScheme {
// return nil
// }
if bc.triedb.Scheme() == rawdb.PathScheme {
return nil
}

// Note: if InsertTrie must be the last step in verification that can return an error.
// This allows [stateManager] to assume that if it inserts a trie without returning an
Expand Down
9 changes: 0 additions & 9 deletions core/blockchain_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ func (basic *snapshotTestBasic) prepare(t *testing.T) (*BlockChain, []*types.Blo
}
startPoint = point

// XXX
// if basic.commitBlock > 0 && basic.commitBlock == point {
// chain.TrieDB().Commit(blocks[point-1].Root(), false)
// }
if basic.snapshotBlock > 0 && basic.snapshotBlock == point {
// Flushing from 0 to snapshotBlock into the disk
for i := uint64(0); i < point; i++ {
Expand Down Expand Up @@ -524,11 +520,6 @@ func TestHighCommitCrashWithNewSnapshot(t *testing.T) {
// Expected head block : C4
// Expected snapshot disk : C4
for _, scheme := range []string{rawdb.HashScheme, rawdb.PathScheme} {
expHead := uint64(0)
if scheme == rawdb.PathScheme {
expHead = uint64(4)
}
_ = expHead // XXX: expHead is not used
test := &crashSnapshotTest{
snapshotTestBasic{
scheme: scheme,
Expand Down
1 change: 0 additions & 1 deletion core/chain_makers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func ExampleGenerateChain() {
// each block and adds different features to gen based on the
// block index.
signer := types.HomesteadSigner{}
// XXX: Why is this 5 in geth?
chain, _, err := GenerateChain(gspec.Config, genesis, dummy.NewCoinbaseFaker(), genDb, 3, 10, func(i int, gen *BlockGen) {
switch i {
case 0:
Expand Down
4 changes: 2 additions & 2 deletions metrics/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func (g gatherer) Gather() ([]*dto.MetricFamily, error) {
},
}},
})
case metrics.GaugeInfo:
// XXX
case metrics.GaugeFloat64:
val := m.Snapshot().Value()
mfs = append(mfs, &dto.MetricFamily{
Expand Down Expand Up @@ -194,5 +196,3 @@ func (g gatherer) Gather() ([]*dto.MetricFamily, error) {
func Gatherer(reg metrics.Registry) prometheus.Gatherer {
return gatherer{reg: reg}
}

// XXX
2 changes: 1 addition & 1 deletion plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ func (vm *VM) setAppRequestHandlers() {
vm.chaindb,
&trie.Config{
HashDB: &hashdb.Config{
CleanCacheSize: vm.config.StateSyncServerTrieCache * units.MiB, // XXX
CleanCacheSize: vm.config.StateSyncServerTrieCache * units.MiB,
},
},
)
Expand Down

0 comments on commit e44d623

Please sign in to comment.