From d0bad2e9c0ad1359a49a130c5ceb98d16bd8ed52 Mon Sep 17 00:00:00 2001 From: toofooboo <167498142+toofooboo@users.noreply.github.com> Date: Sat, 20 Apr 2024 05:45:10 +0800 Subject: [PATCH] chore: fix some typos in comments (#4823) Signed-off-by: toofooboo --- common/ledger/blkstorage/blockfile_mgr.go | 2 +- core/ledger/kvledger/benchmark/README.md | 2 +- core/ledger/kvledger/snapshot_mgmt.go | 2 +- core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go | 2 +- core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go | 2 +- core/ledger/kvledger/txmgmt/validation/batch_preparer.go | 4 ++-- core/ledger/ledger_interface.go | 2 +- core/ledger/pvtdatastorage/store.go | 2 +- internal/fileutil/fileutil.go | 2 +- internal/fileutil/syncdir.go | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/ledger/blkstorage/blockfile_mgr.go b/common/ledger/blkstorage/blockfile_mgr.go index fce0c20f44c..fbcd6b2054c 100644 --- a/common/ledger/blkstorage/blockfile_mgr.go +++ b/common/ledger/blkstorage/blockfile_mgr.go @@ -111,7 +111,7 @@ func newBlockfileMgr(id string, conf *Conf, indexConfig *IndexConfig, indexStore } logger.Debugf("Info constructed by scanning the blocks dir = %s", spew.Sdump(blockfilesInfo)) } else { - logger.Debug(`Synching block information from block storage (if needed)`) + logger.Debug(`Syncing block information from block storage (if needed)`) syncBlockfilesInfoFromFS(rootDir, blockfilesInfo) } err = mgr.saveBlkfilesInfo(blockfilesInfo, true) diff --git a/core/ledger/kvledger/benchmark/README.md b/core/ledger/kvledger/benchmark/README.md index e2e590a9d90..d06bc2d16ef 100644 --- a/core/ledger/kvledger/benchmark/README.md +++ b/core/ledger/kvledger/benchmark/README.md @@ -23,4 +23,4 @@ In order to run the benchmarks, run the following command from folder fabric/cor ./runbenchmarks.sh -f .sh ``` The is expected to contain the parameters for the benchmarks. A sample file (sample_params.sh) is provided. -For running the bechmarks, it is advised to make a copy of the file sample_params.sh and change the parameters that you want to run the tests with. For more details on the parameters and the experiment results, see comments in the file sample_params.sh \ No newline at end of file +For running the benchmarks, it is advised to make a copy of the file sample_params.sh and change the parameters that you want to run the tests with. For more details on the parameters and the experiment results, see comments in the file sample_params.sh \ No newline at end of file diff --git a/core/ledger/kvledger/snapshot_mgmt.go b/core/ledger/kvledger/snapshot_mgmt.go index 312c683bb34..f630b416668 100644 --- a/core/ledger/kvledger/snapshot_mgmt.go +++ b/core/ledger/kvledger/snapshot_mgmt.go @@ -83,7 +83,7 @@ func (l *kvLedger) PendingSnapshotRequests() ([]uint64, error) { return l.snapshotMgr.snapshotRequestBookkeeper.list() } -// processSnapshotMgmtEvents handles each event in the events channel and performs synchronization acorss +// processSnapshotMgmtEvents handles each event in the events channel and performs synchronization across // block commits, snapshot generation, and snapshot request submission/cancellation. // It should be started in a separate goroutine when the ledger is created/opened. // There are 3 unbuffered channels and 5 events working together to process events one by one diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go index 4e1061e5771..3e96d2d7fe9 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go @@ -34,7 +34,7 @@ func TestKVRWSetV1BackwardCompatible(t *testing.T) { // PrepareBinaryFileSampleKVRWSetV1 constructs a proto message for kvrwset and marshals its bytes to file 'kvrwsetV1ProtoBytes'. // this code should be run on fabric version 1.0 so as to produce a sample file of proto message declared in V1 // In order to invoke this function on V1 code, copy this over on to V1 code, make the first letter as 'T', and finally invoke this function -// using golang test framwork +// using golang test framework func PrepareBinaryFileSampleKVRWSetV1(t *testing.T) { b, err := proto.Marshal(constructSampleKVRWSet()) require.NoError(t, err) diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go index 7974c4b52f4..d9aeb942bf1 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go @@ -44,7 +44,7 @@ func TestRWSetV1BackwardCompatible(t *testing.T) { // PrepareBinaryFileSampleRWSetV1 constructs a proto message for kvrwset and marshals its bytes to file 'rwsetV1ProtoBytes'. // this code should be run on fabric version 1.0 so as to produce a sample file of proto message declared in V1 // In order to invoke this function on V1 code, copy this over on to V1 code, make the first letter as 'T', and finally invoke this function -// using golang test framwork +// using golang test framework func PrepareBinaryFileSampleRWSetV1(t *testing.T) { b, err := proto.Marshal(constructSampleRWSet()) require.NoError(t, err) diff --git a/core/ledger/kvledger/txmgmt/validation/batch_preparer.go b/core/ledger/kvledger/txmgmt/validation/batch_preparer.go index 77dd5bed70f..4abfa3b3272 100644 --- a/core/ledger/kvledger/txmgmt/validation/batch_preparer.go +++ b/core/ledger/kvledger/txmgmt/validation/batch_preparer.go @@ -290,7 +290,7 @@ func processNonEndorserTx( txid string, txType common.HeaderType, postOrderSimulatorProvider PostOrderSimulatorProvider, - synchingState bool, + syncingState bool, customTxProcessors map[common.HeaderType]ledger.CustomTxProcessor, ) (*rwset.TxReadWriteSet, error) { logger.Debugf("Performing custom processing for transaction [txid=%s], [txType=%s]", txid, txType) @@ -307,7 +307,7 @@ func processNonEndorserTx( return nil, err } defer sim.Done() - if err = processor.GenerateSimulationResults(txEnv, sim, synchingState); err != nil { + if err = processor.GenerateSimulationResults(txEnv, sim, syncingState); err != nil { return nil, err } if simRes, err = sim.GetTxSimulationResults(); err != nil { diff --git a/core/ledger/ledger_interface.go b/core/ledger/ledger_interface.go index dba9d548d36..ce92d105d4f 100644 --- a/core/ledger/ledger_interface.go +++ b/core/ledger/ledger_interface.go @@ -778,7 +778,7 @@ type ChaincodeLifecycleEventProvider interface { // custom representation, an implementation of a `Processor` should be cautious that the custom representation // is used for simulation in an deterministic fashion and should take care of compatibility cross fabric versions. // 'initializingLedger' true indicates that either the transaction being processed is from the genesis block or the ledger is -// synching the state (which could happen during peer startup if the statedb is found to be lagging behind the blockchain). +// syncing the state (which could happen during peer startup if the statedb is found to be lagging behind the blockchain). // In the former case, the transactions processed are expected to be valid and in the latter case, only valid transactions // are reprocessed and hence any validation can be skipped. type CustomTxProcessor interface { diff --git a/core/ledger/pvtdatastorage/store.go b/core/ledger/pvtdatastorage/store.go index 4b3f58e2e92..b2210d804cb 100644 --- a/core/ledger/pvtdatastorage/store.go +++ b/core/ledger/pvtdatastorage/store.go @@ -397,7 +397,7 @@ func (s *Store) Commit(blockNum uint64, pvtData []*ledger.TxPvtData, missingPvtD // GetLastUpdatedOldBlocksPvtData returns the pvtdata of blocks listed in `lastUpdatedOldBlocksList` // TODO FAB-16293 -- GetLastUpdatedOldBlocksPvtData() can be removed either in v2.0 or in v2.1. // If we decide to rebuild stateDB in v2.0, by default, the rebuild logic would take -// care of synching stateDB with pvtdataStore without calling GetLastUpdatedOldBlocksPvtData(). +// care of syncing stateDB with pvtdataStore without calling GetLastUpdatedOldBlocksPvtData(). // Hence, it can be safely removed. Suppose if we decide not to rebuild stateDB in v2.0, // we can remove this function in v2.1. func (s *Store) GetLastUpdatedOldBlocksPvtData() (map[uint64][]*ledger.TxPvtData, error) { diff --git a/internal/fileutil/fileutil.go b/internal/fileutil/fileutil.go index f3a421ec952..a81afa50722 100644 --- a/internal/fileutil/fileutil.go +++ b/internal/fileutil/fileutil.go @@ -39,7 +39,7 @@ func CreateAndSyncFile(filePath string, content []byte, perm os.FileMode) error return errors.Wrapf(err, "error while writing to file:%s", filePath) } if err = file.Sync(); err != nil { - return errors.Wrapf(err, "error while synching the file:%s", filePath) + return errors.Wrapf(err, "error while syncing the file:%s", filePath) } return nil } diff --git a/internal/fileutil/syncdir.go b/internal/fileutil/syncdir.go index 7917212dd1c..280fbb36312 100644 --- a/internal/fileutil/syncdir.go +++ b/internal/fileutil/syncdir.go @@ -23,7 +23,7 @@ func SyncDir(dirPath string) error { } if err := dir.Sync(); err != nil { dir.Close() - return errors.Wrapf(err, "error while synching dir:%s", dirPath) + return errors.Wrapf(err, "error while syncing dir:%s", dirPath) } if err := dir.Close(); err != nil { return errors.Wrapf(err, "error while closing dir:%s", dirPath)