core: fix typos (#28218)
* fix(core/txpool): fix typos * core/asm: fix typos * core/bloombits: fix typos * core/rawdb: fix typos
This commit is contained in:
parent
f988b2332e
commit
1f6e63900d
|
@ -34,7 +34,7 @@ type instructionIterator struct {
|
||||||
started bool
|
started bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewInstructionIterator create a new instruction iterator.
|
// NewInstructionIterator creates a new instruction iterator.
|
||||||
func NewInstructionIterator(code []byte) *instructionIterator {
|
func NewInstructionIterator(code []byte) *instructionIterator {
|
||||||
it := new(instructionIterator)
|
it := new(instructionIterator)
|
||||||
it.code = code
|
it.code = code
|
||||||
|
|
|
@ -49,7 +49,7 @@ func NewCompiler(debug bool) *Compiler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Feed feeds tokens in to ch and are interpreted by
|
// Feed feeds tokens into ch and are interpreted by
|
||||||
// the compiler.
|
// the compiler.
|
||||||
//
|
//
|
||||||
// feed is the first pass in the compile stage as it collects the used labels in the
|
// feed is the first pass in the compile stage as it collects the used labels in the
|
||||||
|
|
|
@ -72,12 +72,12 @@ func TestLexer(t *testing.T) {
|
||||||
input: "@label123",
|
input: "@label123",
|
||||||
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
|
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
|
||||||
},
|
},
|
||||||
// comment after label
|
// Comment after label
|
||||||
{
|
{
|
||||||
input: "@label123 ;; comment",
|
input: "@label123 ;; comment",
|
||||||
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
|
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
|
||||||
},
|
},
|
||||||
// comment after instruction
|
// Comment after instruction
|
||||||
{
|
{
|
||||||
input: "push 3 ;; comment\nadd",
|
input: "push 3 ;; comment\nadd",
|
||||||
tokens: []token{{typ: lineStart}, {typ: element, text: "push"}, {typ: number, text: "3"}, {typ: lineEnd, text: "\n"}, {typ: lineStart, lineno: 1}, {typ: element, lineno: 1, text: "add"}, {typ: eof, lineno: 1}},
|
tokens: []token{{typ: lineStart}, {typ: element, text: "push"}, {typ: number, text: "3"}, {typ: lineEnd, text: "\n"}, {typ: lineStart, lineno: 1}, {typ: element, lineno: 1, text: "add"}, {typ: eof, lineno: 1}},
|
||||||
|
|
|
@ -58,7 +58,7 @@ type partialMatches struct {
|
||||||
// bit with the given number of fetch elements, or a response for such a request.
|
// bit with the given number of fetch elements, or a response for such a request.
|
||||||
// It can also have the actual results set to be used as a delivery data struct.
|
// It can also have the actual results set to be used as a delivery data struct.
|
||||||
//
|
//
|
||||||
// The contest and error fields are used by the light client to terminate matching
|
// The context and error fields are used by the light client to terminate matching
|
||||||
// early if an error is encountered on some path of the pipeline.
|
// early if an error is encountered on some path of the pipeline.
|
||||||
type Retrieval struct {
|
type Retrieval struct {
|
||||||
Bit uint
|
Bit uint
|
||||||
|
@ -389,7 +389,7 @@ func (m *Matcher) distributor(dist chan *request, session *MatcherSession) {
|
||||||
shutdown = session.quit // Shutdown request channel, will gracefully wait for pending requests
|
shutdown = session.quit // Shutdown request channel, will gracefully wait for pending requests
|
||||||
)
|
)
|
||||||
|
|
||||||
// assign is a helper method fo try to assign a pending bit an actively
|
// assign is a helper method to try to assign a pending bit an actively
|
||||||
// listening servicer, or schedule it up for later when one arrives.
|
// listening servicer, or schedule it up for later when one arrives.
|
||||||
assign := func(bit uint) {
|
assign := func(bit uint) {
|
||||||
select {
|
select {
|
||||||
|
|
|
@ -85,7 +85,7 @@ func TestMatcherRandom(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests that the matcher can properly find matches if the starting block is
|
// Tests that the matcher can properly find matches if the starting block is
|
||||||
// shifter from a multiple of 8. This is needed to cover an optimisation with
|
// shifted from a multiple of 8. This is needed to cover an optimisation with
|
||||||
// bitset matching https://github.com/ethereum/go-ethereum/issues/15309.
|
// bitset matching https://github.com/ethereum/go-ethereum/issues/15309.
|
||||||
func TestMatcherShifted(t *testing.T) {
|
func TestMatcherShifted(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
@ -106,7 +106,7 @@ func TestWildcardMatcher(t *testing.T) {
|
||||||
testMatcherBothModes(t, nil, 0, 10000, 0)
|
testMatcherBothModes(t, nil, 0, 10000, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// makeRandomIndexes generates a random filter system, composed on multiple filter
|
// makeRandomIndexes generates a random filter system, composed of multiple filter
|
||||||
// criteria, each having one bloom list component for the address and arbitrarily
|
// criteria, each having one bloom list component for the address and arbitrarily
|
||||||
// many topic bloom list components.
|
// many topic bloom list components.
|
||||||
func makeRandomIndexes(lengths []int, max int) [][]bloomIndexes {
|
func makeRandomIndexes(lengths []int, max int) [][]bloomIndexes {
|
||||||
|
|
|
@ -200,7 +200,7 @@ func (f *chainFreezer) freeze(db ethdb.KeyValueStore) {
|
||||||
}
|
}
|
||||||
batch.Reset()
|
batch.Reset()
|
||||||
|
|
||||||
// Step into the future and delete and dangling side chains
|
// Step into the future and delete any dangling side chains
|
||||||
if frozen > 0 {
|
if frozen > 0 {
|
||||||
tip := frozen
|
tip := frozen
|
||||||
for len(dangling) > 0 {
|
for len(dangling) > 0 {
|
||||||
|
|
|
@ -34,7 +34,7 @@ import (
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
// freezerdb is a database wrapper that enabled freezer data retrievals.
|
// freezerdb is a database wrapper that enables freezer data retrievals.
|
||||||
type freezerdb struct {
|
type freezerdb struct {
|
||||||
ancientRoot string
|
ancientRoot string
|
||||||
ethdb.KeyValueStore
|
ethdb.KeyValueStore
|
||||||
|
@ -141,7 +141,7 @@ func (db *nofreezedb) ReadAncients(fn func(reader ethdb.AncientReaderOp) error)
|
||||||
// Unlike other ancient-related methods, this method does not return
|
// Unlike other ancient-related methods, this method does not return
|
||||||
// errNotSupported when invoked.
|
// errNotSupported when invoked.
|
||||||
// The reason for this is that the caller might want to do several things:
|
// The reason for this is that the caller might want to do several things:
|
||||||
// 1. Check if something is in freezer,
|
// 1. Check if something is in the freezer,
|
||||||
// 2. If not, check leveldb.
|
// 2. If not, check leveldb.
|
||||||
//
|
//
|
||||||
// This will work, since the ancient-checks inside 'fn' will return errors,
|
// This will work, since the ancient-checks inside 'fn' will return errors,
|
||||||
|
@ -209,7 +209,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st
|
||||||
// of the freezer and database. Ensure that we don't shoot ourselves in the foot
|
// of the freezer and database. Ensure that we don't shoot ourselves in the foot
|
||||||
// by serving up conflicting data, leading to both datastores getting corrupted.
|
// by serving up conflicting data, leading to both datastores getting corrupted.
|
||||||
//
|
//
|
||||||
// - If both the freezer and key-value store is empty (no genesis), we just
|
// - If both the freezer and key-value store are empty (no genesis), we just
|
||||||
// initialized a new empty freezer, so everything's fine.
|
// initialized a new empty freezer, so everything's fine.
|
||||||
// - If the key-value store is empty, but the freezer is not, we need to make
|
// - If the key-value store is empty, but the freezer is not, we need to make
|
||||||
// sure the user's genesis matches the freezer. That will be checked in the
|
// sure the user's genesis matches the freezer. That will be checked in the
|
||||||
|
@ -218,7 +218,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st
|
||||||
// - If neither the key-value store nor the freezer is empty, cross validate
|
// - If neither the key-value store nor the freezer is empty, cross validate
|
||||||
// the genesis hashes to make sure they are compatible. If they are, also
|
// the genesis hashes to make sure they are compatible. If they are, also
|
||||||
// ensure that there's no gap between the freezer and subsequently leveldb.
|
// ensure that there's no gap between the freezer and subsequently leveldb.
|
||||||
// - If the key-value store is not empty, but the freezer is we might just be
|
// - If the key-value store is not empty, but the freezer is, we might just be
|
||||||
// upgrading to the freezer release, or we might have had a small chain and
|
// upgrading to the freezer release, or we might have had a small chain and
|
||||||
// not frozen anything yet. Ensure that no blocks are missing yet from the
|
// not frozen anything yet. Ensure that no blocks are missing yet from the
|
||||||
// key-value store, since that would mean we already had an old freezer.
|
// key-value store, since that would mean we already had an old freezer.
|
||||||
|
@ -634,7 +634,7 @@ func printChainMetadata(db ethdb.KeyValueStore) {
|
||||||
fmt.Fprintf(os.Stderr, "\n\n")
|
fmt.Fprintf(os.Stderr, "\n\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadChainMetadata returns a set of key/value pairs that contains informatin
|
// ReadChainMetadata returns a set of key/value pairs that contains information
|
||||||
// about the database chain status. This can be used for diagnostic purposes
|
// about the database chain status. This can be used for diagnostic purposes
|
||||||
// when investigating the state of the node.
|
// when investigating the state of the node.
|
||||||
func ReadChainMetadata(db ethdb.KeyValueStore) [][]string {
|
func ReadChainMetadata(db ethdb.KeyValueStore) [][]string {
|
||||||
|
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/ethdb/pebble"
|
"github.com/ethereum/go-ethereum/ethdb/pebble"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Pebble is unsuported on 32bit architecture
|
// Pebble is unsupported on 32bit architecture
|
||||||
const PebbleEnabled = true
|
const PebbleEnabled = true
|
||||||
|
|
||||||
// NewPebbleDBDatabase creates a persistent key-value database without a freezer
|
// NewPebbleDBDatabase creates a persistent key-value database without a freezer
|
||||||
|
|
|
@ -219,7 +219,7 @@ func (b *tableBatch) Put(key, value []byte) error {
|
||||||
return b.batch.Put(append([]byte(b.prefix), key...), value)
|
return b.batch.Put(append([]byte(b.prefix), key...), value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete inserts the a key removal into the batch for later committing.
|
// Delete inserts a key removal into the batch for later committing.
|
||||||
func (b *tableBatch) Delete(key []byte) error {
|
func (b *tableBatch) Delete(key []byte) error {
|
||||||
return b.batch.Delete(append([]byte(b.prefix), key...))
|
return b.batch.Delete(append([]byte(b.prefix), key...))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue