Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo Fix: "Transcation" to "Transaction" #4248

Merged
merged 4 commits into from
Sep 17, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ type Local struct {
// TraceServer is a host:port to report graph propagation trace info to.
NetworkMessageTraceServer string `version[13]:""`

// VerifiedTranscationsCacheSize defines the number of transactions that the verified transactions cache would hold before cycling the cache storage in a round-robin fashion.
VerifiedTranscationsCacheSize int `version[14]:"30000"`
// VerifiedTransactionsCacheSize defines the number of transactions that the verified transactions cache would hold before cycling the cache storage in a round-robin fashion.
VerifiedTransactionsCacheSize int `version[14]:"30000"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I don't think we can change this one. Since it's in the config file it could break existing configs.

@algorandskiy do you know if there's a way to fix this typo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would have to introduce both names, and have one copy its value to the other at startup time, and error if they were both set

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert this part of the change and we can fix just the other typos?


// EnableCatchupFromArchiveServers controls which peers the catchup service would use in order to catchup.
// When enabled, the catchup service would use the archive servers before falling back to the relays.
Expand Down
2 changes: 1 addition & 1 deletion config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@ var defaultLocal = Local{
TxSyncServeResponseSize: 1000000,
TxSyncTimeoutSeconds: 30,
UseXForwardedForAddressField: "",
VerifiedTranscationsCacheSize: 30000,
VerifiedTransactionsCacheSize: 30000,
}
10 changes: 5 additions & 5 deletions data/transactions/verify/verifiedTxnCache.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ type VerifiedTransactionCache interface {
Add(txgroup []transactions.SignedTxn, groupCtx *GroupContext)
// AddPayset works in a similar way to Add, but is intended for adding an array of transaction groups, along with their corresponding contexts.
AddPayset(txgroup [][]transactions.SignedTxn, groupCtxs []*GroupContext) error
// GetUnverifiedTranscationGroups compares the provided payset against the currently cached transactions and figure which transaction groups aren't fully cached.
GetUnverifiedTranscationGroups(payset [][]transactions.SignedTxn, CurrSpecAddrs transactions.SpecialAddresses, CurrProto protocol.ConsensusVersion) [][]transactions.SignedTxn
// GetUnverifiedTransactionGroups compares the provided payset against the currently cached transactions and figure which transaction groups aren't fully cached.
GetUnverifiedTransactionGroups(payset [][]transactions.SignedTxn, CurrSpecAddrs transactions.SpecialAddresses, CurrProto protocol.ConsensusVersion) [][]transactions.SignedTxn
// UpdatePinned replaces the pinned entries with the one provided in the pinnedTxns map. This is typically expected to be a subset of the
// already-pinned transactions. If a transaction is not currently pinned, and it's can't be found in the cache, a errMissingPinnedEntry error would be generated.
UpdatePinned(pinnedTxns map[transactions.Txid]transactions.SignedTxn) error
Expand Down Expand Up @@ -115,8 +115,8 @@ func (v *verifiedTransactionCache) AddPayset(txgroup [][]transactions.SignedTxn,
return nil
}

// GetUnverifiedTranscationGroups compares the provided payset against the currently cached transactions and figure which transaction groups aren't fully cached.
func (v *verifiedTransactionCache) GetUnverifiedTranscationGroups(txnGroups [][]transactions.SignedTxn, currSpecAddrs transactions.SpecialAddresses, currProto protocol.ConsensusVersion) (unverifiedGroups [][]transactions.SignedTxn) {
// GetUnverifiedTransactionGroups compares the provided payset against the currently cached transactions and figure which transaction groups aren't fully cached.
func (v *verifiedTransactionCache) GetUnverifiedTransactionGroups(txnGroups [][]transactions.SignedTxn, currSpecAddrs transactions.SpecialAddresses, currProto protocol.ConsensusVersion) (unverifiedGroups [][]transactions.SignedTxn) {
v.bucketsLock.Lock()
defer v.bucketsLock.Unlock()
groupCtx := &GroupContext{
Expand Down Expand Up @@ -272,7 +272,7 @@ func (v *mockedCache) AddPayset(txgroup [][]transactions.SignedTxn, groupCtxs []
return nil
}

func (v *mockedCache) GetUnverifiedTranscationGroups(txnGroups [][]transactions.SignedTxn, currSpecAddrs transactions.SpecialAddresses, currProto protocol.ConsensusVersion) (unverifiedGroups [][]transactions.SignedTxn) {
func (v *mockedCache) GetUnverifiedTransactionGroups(txnGroups [][]transactions.SignedTxn, currSpecAddrs transactions.SpecialAddresses, currProto protocol.ConsensusVersion) (unverifiedGroups [][]transactions.SignedTxn) {
if v.alwaysVerified {
return nil
}
Expand Down
8 changes: 4 additions & 4 deletions data/transactions/verify/verifiedTxnCache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestBucketCycling(t *testing.T) {
require.Equal(t, 1, len(impl.buckets[0]))
}

func TestGetUnverifiedTranscationGroups50(t *testing.T) {
func TestGetUnverifiedTransactionGroups50(t *testing.T) {
partitiontest.PartitionTest(t)

size := 300
Expand All @@ -97,11 +97,11 @@ func TestGetUnverifiedTranscationGroups50(t *testing.T) {
}
}

unverifiedGroups := impl.GetUnverifiedTranscationGroups(txnGroups, spec, protocol.ConsensusCurrentVersion)
unverifiedGroups := impl.GetUnverifiedTransactionGroups(txnGroups, spec, protocol.ConsensusCurrentVersion)
require.Equal(t, len(expectedUnverifiedGroups), len(unverifiedGroups))
}

func BenchmarkGetUnverifiedTranscationGroups50(b *testing.B) {
func BenchmarkGetUnverifiedTransactionGroups50(b *testing.B) {
if b.N < 20000 {
b.N = 20000
}
Expand All @@ -125,7 +125,7 @@ func BenchmarkGetUnverifiedTranscationGroups50(b *testing.B) {
startTime := time.Now()
measuringMultipler := 1000
for i := 0; i < measuringMultipler; i++ {
impl.GetUnverifiedTranscationGroups(queryTxnGroups, spec, protocol.ConsensusCurrentVersion)
impl.GetUnverifiedTransactionGroups(queryTxnGroups, spec, protocol.ConsensusCurrentVersion)
}
duration := time.Now().Sub(startTime)
// calculate time per 10K verified entries:
Expand Down
2 changes: 1 addition & 1 deletion installer/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion ledger/internal/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ func (validator *evalTxValidator) run() {
unverifiedTxnGroups = append(unverifiedTxnGroups, signedTxnGroup)
}

unverifiedTxnGroups = validator.txcache.GetUnverifiedTranscationGroups(unverifiedTxnGroups, specialAddresses, validator.block.BlockHeader.CurrentProtocol)
unverifiedTxnGroups = validator.txcache.GetUnverifiedTransactionGroups(unverifiedTxnGroups, specialAddresses, validator.block.BlockHeader.CurrentProtocol)

err := verify.PaysetGroups(validator.ctx, unverifiedTxnGroups, validator.block.BlockHeader, validator.verificationPool, validator.txcache)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ledger/internal/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ func newTestLedger(t testing.TB, balances bookkeeping.GenesisBalances) *evalTest
// not a valid block (e.g., it has duplicate transactions, overspends some
// account, etc).
func (ledger *evalTestLedger) Validate(ctx context.Context, blk bookkeeping.Block, executionPool execpool.BacklogPool) (*ledgercore.ValidatedBlock, error) {
verifiedTxnCache := verify.MakeVerifiedTransactionCache(config.GetDefaultLocal().VerifiedTranscationsCacheSize)
verifiedTxnCache := verify.MakeVerifiedTransactionCache(config.GetDefaultLocal().VerifiedTransactionsCacheSize)

delta, err := Eval(ctx, ledger, blk, true, verifiedTxnCache, executionPool)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions ledger/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ func OpenLedger(
log logging.Logger, dbPathPrefix string, dbMem bool, genesisInitState ledgercore.InitState, cfg config.Local,
) (*Ledger, error) {
var err error
verifiedCacheSize := cfg.VerifiedTranscationsCacheSize
verifiedCacheSize := cfg.VerifiedTransactionsCacheSize
if verifiedCacheSize < cfg.TxPoolSize {
verifiedCacheSize = cfg.TxPoolSize
log.Warnf("The VerifiedTranscationsCacheSize in the config file was misconfigured to have smaller size then the TxPoolSize; The verified cache size was adjusted from %d to %d.", cfg.VerifiedTranscationsCacheSize, cfg.TxPoolSize)
log.Warnf("The VerifiedTransactionsCacheSize in the config file was misconfigured to have smaller size then the TxPoolSize; The verified cache size was adjusted from %d to %d.", cfg.VerifiedTransactionsCacheSize, cfg.TxPoolSize)
}

l := &Ledger{
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v14.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v15.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v16.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v17.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v18.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v19.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v20.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v21.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v22.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}
2 changes: 1 addition & 1 deletion test/testdata/configs/config-v23.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@
"TxSyncServeResponseSize": 1000000,
"TxSyncTimeoutSeconds": 30,
"UseXForwardedForAddressField": "",
"VerifiedTranscationsCacheSize": 30000
"VerifiedTransactionsCacheSize": 30000
}