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

go-algorand 3.2.2-stable #3305

Merged
merged 5 commits into from
Dec 13, 2021
Merged

go-algorand 3.2.2-stable #3305

merged 5 commits into from
Dec 13, 2021

Conversation

Algo-devops-service
Copy link
Contributor

@Algo-devops-service Algo-devops-service commented Dec 10, 2021

GitHub Logo

Changelog

  1. Catchup
  2. Goal

Protocol Upgrade

This release does not contain a protocol upgrade.

Additional Resources

winder and others added 5 commits December 9, 2021 22:19
## Summary

Compatibility for `partkeyinfo` was also needed by some users. In addition to the different format, the old command also allows printing key information when the node is not running

Workarounds:
1) use an older `goal` binary.
2) use `algokey part info --keyfile <file>`

## Test Plan

Tested manually:
```
~$ goal account partkeyinfo -d /tmp/private_network/Node/
Dumping participation key info from /tmp/private_network/Node/...

Participation ID:          CPLHRU3WEY3PE7XTPPSIE7BGJYWAIFPS7DL3HZNC4OKQRQ5YAYUA
Parent address:            DGS6VNX2BRMKGKVAS2LTREMYG33TOCYPFLPCQ3DUTJULQU6P6S7KJCDNTU
Last vote round:           1
Last block proposal round: 2
Effective first round:     1
Effective last round:      3000000
First round:               0
Last round:                3000000
Key dilution:              10000
Selection key:             5QRrTgzSUTqqym43QVsBus1/AOwGR5zE+I7FGwA14vQ=
Voting key:                PK0NMyZ4BKSjPQ9JuT7dQBLdTpjLQv2txuDYDKhkuqs=

~$ goal account partkeyinfo -d /tmp/private_network/Node/ -c
Dumping participation key info from /tmp/private_network/Node/...
------------------------------------------------------------------
File: Wallet2.0.3000000.partkey
{
  "acct": "DGS6VNX2BRMKGKVAS2LTREMYG33TOCYPFLPCQ3DUTJULQU6P6S7KJCDNTU",
  "last": 3000000,
  "sel": "5QRrTgzSUTqqym43QVsBus1/AOwGR5zE+I7FGwA14vQ=",
  "vote": "PK0NMyZ4BKSjPQ9JuT7dQBLdTpjLQv2txuDYDKhkuqs=",
  "voteKD": 10000
}
```
… in (#3299)

The catchup service stops when it is complete, i.e. it has reached up to the round which is being agreed on.

The catchup service knows it is complete and should stop, when it finds that a block is in the ledger before it adds it.
In other words, apart from the catchup, only the agreement adds blocks to the ledger. And when the agreement adds a block to the ledger before the catchup, it means the agreement is ahead, and the catchup is complete.

When `fetchAndWrite` detects the block is already in the ledger, it returns. The return value of `false` stops the catchup syncing. 

In previous releases, `fetchAndWrite` was only checking if the block is already in the ledger after attempting to fetch it. 
Since it fails to fetch a block not yet agreed on, the fetch fails after multiple attempts, and `fetchAndWrite` returns `false` ending the catchup.

A recent change made this process more efficient by first checking if the block is in the ledger before/during the fetch.
However, once the block was found in the ledger, `fetchAndWrite` returned true instead of false (consistent with already existing logic since forever, which was also wrong). This caused the catchup to continue syncing after catchup was complete.
This change fixes the return value from true to false.
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2021

Codecov Report

Merging #3305 (34b3eca) into rel/stable (b6cbbf3) will decrease coverage by 0.02%.
The diff coverage is 14.28%.

Impacted file tree graph

@@              Coverage Diff               @@
##           rel/stable    #3305      +/-   ##
==============================================
- Coverage       47.40%   47.37%   -0.03%     
==============================================
  Files             369      369              
  Lines           59620    59649      +29     
==============================================
- Hits            28261    28258       -3     
- Misses          28078    28110      +32     
  Partials         3281     3281              
Impacted Files Coverage Δ
cmd/goal/account.go 13.17% <6.66%> (-0.37%) ⬇️
catchup/service.go 69.15% <60.00%> (-0.18%) ⬇️
ledger/blockqueue.go 81.03% <0.00%> (-4.03%) ⬇️
data/transactions/verify/txn.go 44.29% <0.00%> (ø)
ledger/acctupdates.go 65.96% <0.00%> (+0.19%) ⬆️
netdeploy/networkTemplate.go 31.19% <0.00%> (+1.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6cbbf3...34b3eca. Read the comment docs.

@onetechnical onetechnical marked this pull request as ready for review December 13, 2021 12:02
@algojohnlee algojohnlee merged commit 97e8068 into algorand:rel/stable Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants