rocksdb #29

Merged
jeffreypicard merged 93 commits from feature/27/jeffreypicard/rocksdb into master 2022-04-29 17:04:01 +02:00
2 changed files with 19 additions and 6 deletions
Showing only changes of commit 7d492948ce - Show all commits

View file

@ -37,11 +37,7 @@ func PrepareResolveResult(
return nil, err
}
var txCounts []interface{}
txCounts = db.TxCounts.GetSlice()
txCounts = txCounts[:db.TxCounts.Len()]
height := BisectRight(txCounts, txNum)
createdHeight := BisectRight(txCounts, rootTxNum)
height, createdHeight := db.TxCounts.TxCountsBisectRight(txNum, rootTxNum, BisectRight)
lastTakeoverHeight := controllingClaim.Height
expirationHeight := GetExpirationHeight(height)

View file

@ -1,6 +1,8 @@
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
package db_stack
import "sync"
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
import (
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
"sync"
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
)
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
type SliceBackedStack struct {
slice []interface{}
@ -77,3 +79,18 @@ func (s *SliceBackedStack) GetSlice() []interface{} {
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
// This is not thread safe so I won't bother with locking
return s.slice
}
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
// This function is dangerous because it assumes underlying types
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
func (s *SliceBackedStack) TxCountsBisectRight(
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
txNum, rootTxNum uint32,
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
bisectFunc func([]interface{}, uint32) uint32,
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
) (uint32, uint32) {
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
s.mut.RLock()
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
defer s.mut.RUnlock()
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
txCounts := s.slice[:s.Len()]
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
height := bisectFunc(txCounts, txNum)
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
createdHeight := bisectFunc(txCounts, rootTxNum)
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
return height, createdHeight
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
}
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again

lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again
lyoshenka commented 2022-03-24 22:46:33 +01:00 (Migrated from github.com)
Review

every call of this uses the same bisect function. does it make sense to pass it in?

every call of this uses the same bisect function. does it make sense to pass it in?
jeffreypicard commented 2022-04-11 19:01:08 +02:00 (Migrated from github.com)
Review

agreed, changed.

agreed, changed.
lyoshenka commented 2022-04-15 16:04:36 +02:00 (Migrated from github.com)
Review

this is already a subpackage of db. it should be called stack, not db_stack

this is already a subpackage of `db`. it should be called `stack`, not `db_stack`
lyoshenka commented 2022-04-15 16:05:18 +02:00 (Migrated from github.com)
Review

assuming this package is named stack, this should just be SliceBacked. no need to put stack in the name again

assuming this package is named `stack`, this should just be `SliceBacked`. no need to put stack in the name again