Skip to content

Commit

Permalink
Merge branch 'dev' into make_write_current_stakers_testable
Browse files Browse the repository at this point in the history
  • Loading branch information
abi87 authored Sep 22, 2023
2 parents 34d5602 + 3c60ac7 commit cddf51c
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 23 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ linters:
- asciicheck
- bodyclose
- depguard
- dupword
- errcheck
- errorlint
- exportloopref
Expand Down
7 changes: 0 additions & 7 deletions api/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ type keystore struct {
// Used to persist users and their data
userDB database.Database
bcDB database.Database
// BaseDB
// / \
// UserDB BlockchainDB
// / | \
// Usr Usr Usr
// / | \
// BID BID BID
}

func New(log logging.Logger, dbManager manager.Manager) Keystore {
Expand Down
2 changes: 1 addition & 1 deletion chains/atomic/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (s *state) SetValue(e *Element) error {
//
// This implies that chains interacting with shared memory must be able to
// generate their chain state without actually performing the read of shared
// memory. Shared memory should only be used to verify that the the transition
// memory. Shared memory should only be used to verify that the transition
// being performed is valid. That ensures that such verification can be skipped
// during bootstrapping. It is up to the chain to ensure this based on the
// current engine state.
Expand Down
2 changes: 1 addition & 1 deletion database/test_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ func TestIterator(t *testing.T, db Database) {
require.NoError(iterator.Error())
}

// TestIteratorStart tests to make sure the the iterator can be configured to
// TestIteratorStart tests to make sure the iterator can be configured to
// start mid way through the database.
func TestIteratorStart(t *testing.T, db Database) {
require := require.New(t)
Expand Down
2 changes: 1 addition & 1 deletion network/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type HealthConfig struct {
Enabled bool `json:"-"`

// MinConnectedPeers is the minimum number of peers that the network should
// be connected to to be considered healthy.
// be connected to be considered healthy.
MinConnectedPeers uint `json:"minConnectedPeers"`

// MaxTimeSinceMsgReceived is the maximum amount of time since the network
Expand Down
2 changes: 1 addition & 1 deletion snow/consensus/snowman/topological.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func (ts *Topological) vote(ctx context.Context, voteStack []votes) (ids.ID, err
// get the block that we are going to vote on
parentBlock, notRejected := ts.blocks[vote.parentID]

// if the block block we are going to vote on was already rejected, then
// if the block we are going to vote on was already rejected, then
// we should stop applying the votes
if !notRejected {
break
Expand Down
5 changes: 0 additions & 5 deletions snow/engine/common/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ func (b *bootstrapper) markAcceptedFrontierReceived(ctx context.Context, nodeID
// Ask each bootstrap validator to filter the list of containers that we were
// told are on the accepted frontier such that the list only contains containers
// they think are accepted.
//
// Create a newAlpha taking using the sampled beacon
// Keep the proportion of b.Alpha in the newAlpha
// newAlpha := totalSampledWeight * b.Alpha / totalWeight

newAlpha := float64(b.sampledBeacons.Weight()*b.Alpha) / float64(b.Beacons.Weight())

failedBeaconWeight := b.Beacons.SubsetWeight(b.failedAcceptedFrontier)
Expand Down
2 changes: 1 addition & 1 deletion snow/networking/handler/message_queue_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (m *messageQueueMetrics) initialize(
opMetric := prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Name: fmt.Sprintf("%s_count", opStr),
Help: fmt.Sprintf("Number of of %s messages in the message queue.", opStr),
Help: fmt.Sprintf("Number of %s messages in the message queue.", opStr),
})
m.ops[op] = opMetric
errs.Add(metricsRegisterer.Register(opMetric))
Expand Down
2 changes: 1 addition & 1 deletion utils/crypto/bls/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
errFailedSecretKeyDeserialize = errors.New("couldn't deserialize secret key")

// The ciphersuite is more commonly known as G2ProofOfPossession.
// There are two digests to ensure that that message space for normal
// There are two digests to ensure that message space for normal
// signatures and the proof of possession are distinct.
ciphersuiteSignature = []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_")
ciphersuiteProofOfPossession = []byte("BLS_POP_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_")
Expand Down
2 changes: 1 addition & 1 deletion vms/components/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (i *indexer) Accept(txID ids.ID, inputUTXOs []*avax.UTXO, outputUTXOs []*av

// Read returns IDs of transactions that changed [address]'s balance of [assetID],
// starting at [cursor], in order of transaction acceptance. e.g. if [cursor] == 1, does
// not return the first transaction that changed the balance. (This is for for pagination.)
// not return the first transaction that changed the balance. (This is for pagination.)
// Returns at most [pageSize] elements.
// See AddressTxsIndexer
func (i *indexer) Read(address []byte, assetID ids.ID, cursor, pageSize uint64) ([]ids.ID, error) {
Expand Down
7 changes: 3 additions & 4 deletions vms/platformvm/txs/mempool/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ type Mempool interface {
// It's guaranteed that the returned tx, if not nil, is a StakerTx.
PeekStakerTx() *txs.Tx

// Note: dropped txs are added to droppedTxIDs but not
// not evicted from unissued decision/staker txs.
// This allows previously dropped txs to be possibly
// reissued.
// Note: dropped txs are added to droppedTxIDs but are not evicted from
// unissued decision/staker txs. This allows previously dropped txs to be
// possibly reissued.
MarkDropped(txID ids.ID, reason error)
GetDropReason(txID ids.ID) error
}
Expand Down

0 comments on commit cddf51c

Please sign in to comment.