go-algorand icon indicating copy to clipboard operation
go-algorand copied to clipboard

catchup: pause on round

Open algoganesh opened this issue 2 years ago • 6 comments

Summary

We want the ability to pause a node on a particular round.

  • goal node start --round <round>
  • algod -round <round> Starts the node and only catches up to the block number <round>

Test Plan

algoganesh avatar May 31 '22 19:05 algoganesh

Codecov Report

Merging #4060 (6258402) into master (9237316) will decrease coverage by 0.05%. The diff coverage is 43.18%.

@@            Coverage Diff             @@
##           master    #4060      +/-   ##
==========================================
- Coverage   54.55%   54.49%   -0.06%     
==========================================
  Files         391      391              
  Lines       48665    48707      +42     
==========================================
- Hits        26549    26545       -4     
- Misses      19890    19932      +42     
- Partials     2226     2230       +4     
Impacted Files Coverage Δ
cmd/algod/main.go 0.00% <0.00%> (ø)
daemon/algod/server.go 4.96% <0.00%> (-0.04%) :arrow_down:
node/node.go 23.01% <0.00%> (-1.95%) :arrow_down:
nodecontrol/NodeController.go 22.85% <ø> (ø)
nodecontrol/algodControl.go 3.92% <0.00%> (-0.08%) :arrow_down:
cmd/goal/node.go 11.14% <50.00%> (+0.23%) :arrow_up:
catchup/service.go 68.11% <58.06%> (-1.27%) :arrow_down:
ledger/roundlru.go 90.56% <0.00%> (-5.67%) :arrow_down:
ledger/tracker.go 74.45% <0.00%> (-2.17%) :arrow_down:
agreement/cryptoVerifier.go 67.60% <0.00%> (-2.12%) :arrow_down:
... and 6 more

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 9237316...6258402. Read the comment docs.

codecov[bot] avatar Jun 03 '22 20:06 codecov[bot]

This is a very intrusive change in a critical path of the node's function. Is there a document making the business case for this feature?

algonautshant avatar Jun 08 '22 18:06 algonautshant

This is a very intrusive change in a critical path of the node's function. Is there a document making the business case for this feature?

Thanks for looking Shant. Do you know of a less intrusive way?

This feature solves several problems:

  1. We would use it for Indexer, where we need to initialize a ledger to a particular round.
  2. People who need to observe account state at a particular round would now be able to do so.
  3. When troubleshooting issues, it's frequently useful to setup a node to a particular round before attaching a debugger and inspecting the behavior.
  4. Automated tests could leverage this functionality to be more deterministic.

winder avatar Jun 08 '22 20:06 winder

In order to achieve these objectives, stopping/pausing at the catchup will work as long as the node is behind the most recent block. Once at the edge, the agreement service will start adding blocks to the ledger.

algonautshant avatar Jun 09 '22 00:06 algonautshant

What we want to accomplish with this? To allow developers to debug their contracts at round? Or something else?

algorandskiy avatar Jun 11 '22 16:06 algorandskiy

What we want to accomplish with this? To allow developers to debug their contracts at round? Or something else?

@algorandskiy It's an added capability like dev-mode that gives us more control over algod. Here are some use cases: https://github.com/algorand/go-algorand/pull/4060#issuecomment-1150351779

winder avatar Jun 14 '22 13:06 winder