Skip to content

Commit ae29303

Browse files
committed
Merge remote-tracking branch 'upstream/master' into shant/async_vote_bench
2 parents 92aa0dc + f8a9746 commit ae29303

File tree

124 files changed

+9116
-2634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+9116
-2634
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ index.html
6868

6969
# test summary
7070
testresults.json
71+
72+
# block generator binary
73+
tools/block-generator/block-generator

agreement/agreementtest/simulate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (b *blackhole) Address() (string, bool) {
129129
// CryptoRandomSource is a random source that is based off our crypto library.
130130
type CryptoRandomSource struct{}
131131

132-
// Uint64 implements the randomness by calling hte crypto library.
132+
// Uint64 implements the randomness by calling the crypto library.
133133
func (c *CryptoRandomSource) Uint64() uint64 {
134134
return crypto.RandUint64()
135135
}

catchup/service.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ type Service struct {
8383
deadlineTimeout time.Duration
8484
blockValidationPool execpool.BacklogPool
8585

86-
// suspendForCatchpointWriting defines whether we've ran into a state where the ledger is currently busy writing the
86+
// suspendForCatchpointWriting defines whether we've run into a state where the ledger is currently busy writing the
8787
// catchpoint file. If so, we want to suspend the catchup process until the catchpoint file writing is complete,
8888
// and resume from there without stopping the catchup timer.
8989
suspendForCatchpointWriting bool
@@ -233,10 +233,10 @@ func (s *Service) innerFetch(r basics.Round, peer network.Peer) (blk *bookkeepin
233233

234234
// fetchAndWrite fetches a block, checks the cert, and writes it to the ledger. Cert checking and ledger writing both wait for the ledger to advance if necessary.
235235
// Returns false if we should stop trying to catch up. This may occur for several reasons:
236-
// - If the context is canceled (e.g. if the node is shutting down)
237-
// - If we couldn't fetch the block (e.g. if there are no peers available or we've reached the catchupRetryLimit)
238-
// - If the block is already in the ledger (e.g. if agreement service has already written it)
239-
// - If the retrieval of the previous block was unsuccessful
236+
// - If the context is canceled (e.g. if the node is shutting down)
237+
// - If we couldn't fetch the block (e.g. if there are no peers available, or we've reached the catchupRetryLimit)
238+
// - If the block is already in the ledger (e.g. if agreement service has already written it)
239+
// - If the retrieval of the previous block was unsuccessful
240240
func (s *Service) fetchAndWrite(r basics.Round, prevFetchCompleteChan chan bool, lookbackComplete chan bool, peerSelector *peerSelector) bool {
241241
// If sync-ing this round is not intended, don't fetch it
242242
if dontSyncRound := s.GetDisableSyncRound(); dontSyncRound != 0 && r >= basics.Round(dontSyncRound) {
@@ -258,10 +258,10 @@ func (s *Service) fetchAndWrite(r basics.Round, prevFetchCompleteChan chan bool,
258258
loggedMessage := fmt.Sprintf("fetchAndWrite(%d): block retrieval exceeded retry limit", r)
259259
if _, initialSync := s.IsSynchronizing(); initialSync {
260260
// on the initial sync, it's completly expected that we won't be able to get all the "next" blocks.
261-
// Therefore info should suffice.
261+
// Therefore, info should suffice.
262262
s.log.Info(loggedMessage)
263263
} else {
264-
// On any subsequent sync, we migth be looking for multiple rounds into the future, so it's completly
264+
// On any subsequent sync, we might be looking for multiple rounds into the future, so it's completely
265265
// reasonable that we would fail retrieving the future block.
266266
// Generate a warning here only if we're failing to retrieve X+1 or below.
267267
// All other block retrievals should not generate a warning.
@@ -294,7 +294,7 @@ func (s *Service) fetchAndWrite(r basics.Round, prevFetchCompleteChan chan bool,
294294
s.log.Debugf("fetchAndWrite(%v): Could not fetch: %v (attempt %d)", r, err, i)
295295
peerSelector.rankPeer(psp, peerRankDownloadFailed)
296296
// we've just failed to retrieve a block; wait until the previous block is fetched before trying again
297-
// to avoid the usecase where the first block doesn't exists and we're making many requests down the chain
297+
// to avoid the usecase where the first block doesn't exist, and we're making many requests down the chain
298298
// for no reason.
299299
if !hasLookback {
300300
select {
@@ -479,7 +479,7 @@ func (s *Service) pipelinedFetch(seedLookback uint64) {
479479
go func() {
480480
defer wg.Done()
481481
for t := range taskCh {
482-
completed <- t() // This write to completed comes after a read from taskCh, so the invariant is preserved.
482+
completed <- t() // This write comes after a read from taskCh, so the invariant is preserved.
483483
}
484484
}()
485485
}
@@ -632,10 +632,10 @@ func (s *Service) periodicSync() {
632632
}
633633

634634
// Syncs the client with the network. sync asks the network for last known block and tries to sync the system
635-
// up the to the highest number it gets.
635+
// up to the highest number it gets.
636636
func (s *Service) sync() {
637637
// Only run sync once at a time
638-
// Store start time of sync - in NS so we can compute time.Duration (which is based on NS)
638+
// Store start time of sync - in NS, so we can compute time.Duration (which is based on NS)
639639
start := time.Now()
640640

641641
timeInNS := start.UnixNano()

cmd/algocfg/profileCommand.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ var setProfileCmd = &cobra.Command{
143143
}
144144
file := filepath.Join(dataDir, config.ConfigFilename)
145145
if _, err := os.Stat(file); !forceUpdate && err == nil {
146-
fmt.Printf("A config.json file already exists for this data directory. Would you like to overwrite it? (Y/n)")
146+
fmt.Printf("A config.json file already exists at %s\nWould you like to overwrite it? (Y/n)", file)
147147
reader := bufio.NewReader(os.Stdin)
148148
resp, err := reader.ReadString('\n')
149149
resp = strings.TrimSpace(resp)

cmd/goal/clerk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ var simulateCmd = &cobra.Command{
12691269

12701270
dataDir := datadir.EnsureSingleDataDir()
12711271
client := ensureFullClient(dataDir)
1272-
resp, err := client.TransactionSimulation(data)
1272+
resp, err := client.SimulateRawTransaction(data)
12731273
if err != nil {
12741274
reportErrorf("simulation error: %s", err.Error())
12751275
}

0 commit comments

Comments
 (0)