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

feat: migrating localnet to latest indexer v3.x images #351

Merged
merged 10 commits into from
Nov 22, 2023

Conversation

aorumbayev
Copy link
Collaborator

@aorumbayev aorumbayev commented Nov 13, 2023

Proposed Changes

  • Adds support and migrates to -> official indexer v3 image (latest tag as of today)
  • Adds required dependency on conduit which forces using extra algod follower container that does slow down execution of certain operations as well as boot up and shut down time of compose environment

Related improvements

  • Adding pytest-xdist to speed up test execution

@aorumbayev aorumbayev marked this pull request as draft November 14, 2023 10:30
@Loedn Loedn linked an issue Nov 14, 2023 that may be closed by this pull request
Copy link

github-actions bot commented Nov 14, 2023

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit
   __init__.py15753%6–13, 17–24, 32–34
   __main__.py220%1–3
src/algokit/cli
   completions.py108298%83, 98
   deploy.py72790%44, 46, 89–91, 155, 179
   dispenser.py118199%75
   doctor.py48394%142–144
   explore.py501276%34–39, 41–46
   generate.py63198%118
   goal.py39197%57
   init.py1901692%273–274, 324, 327–329, 340, 384, 410, 450, 459–461, 464–469, 482
   localnet.py93397%162, 183–184
src/algokit/cli/common
   utils.py26292%120, 123
src/algokit/cli/tasks
   assets.py821384%65–66, 72, 74–75, 105, 119, 125–126, 132, 134, 136–137
   ipfs.py541180%54, 84, 89–91, 96, 98–99, 109–111
   mint.py66494%48, 70, 91, 247
   send_transaction.py651085%52–53, 57, 89, 158, 170–174
   sign_transaction.py59886%21, 28–30, 71–72, 109, 123
   transfer.py37392%25, 89, 116
   utils.py994555%26–34, 40–43, 75–76, 100–101, 125–133, 152–162, 209, 258–259, 279–290, 297–299
   vanity_address.py561082%41, 45–48, 112, 114, 121–123
   wallet.py79495%21, 66, 136, 162
src/algokit/core
   bootstrap.py1612485%103–104, 126, 149, 214, 217, 223–237, 246–251
   conf.py54885%10, 24, 28, 36, 38, 71–73
   deploy.py691184%61–64, 73–75, 79, 84, 91–93
   dispenser.py2022687%91, 123–124, 141–149, 191–192, 198–200, 218–219, 259–260, 318, 332–334, 345–346, 356, 369, 384
   doctor.py65789%67–69, 92–94, 134
   generate.py41295%68, 86
   goal.py60395%30–31, 41
   log_handlers.py68790%50–51, 63, 112–116, 125
   proc.py45198%98
   sandbox.py1991692%70, 116–123, 134, 429, 445, 460–462, 478
   typed_client_generation.py80594%55–57, 70, 75
   utils.py18289%27–28
   version_prompt.py73889%27–28, 40, 59–62, 80, 109
src/algokit/core/tasks
   ipfs.py57493%133, 137, 139, 145
   nfd.py491373%25, 31, 34–41, 70–72, 99–101
   vanity_address.py903462%49–50, 54, 59–75, 92–108, 128–131
   wallet.py71593%37, 129, 155–157
src/algokit/core/tasks/mint
   mint.py781087%123–133, 187
   models.py901188%50, 52, 57, 71–74, 85–88
TOTAL318536289% 

Tests Skipped Failures Errors Time
382 0 💤 0 ❌ 0 🔥 14.056s ⏱️

@aorumbayev
Copy link
Collaborator Author

@winder a few further questions to clarify if possible (cc @robdmoore @neilcampbell )

I was able to execute the algod container with 2 networks (relay participation and one follower nodes). It wasn't clear that network configurations are passed differently that config.json which is why i was confused initially. If you execute the compose on the contents of the attached archive you will see that it seems to be working fine. Conduit is able to chat with 8081 port on algod (which is the port for the follower, while relay is at 8080). There is a slight millisecond delay that still happens with this setup where fresh deployment of an app takes certain amount of time before it pops up on indexer search application by account endpoint response -> will require adding some tweaks to our fixtures on utils ts and py (cc @neilcampbell @robdmoore )

  1. The configuration attached is generated from the compose file here - for the sake of simplicity for yourself to check it out. Despite setup working as expected (conduit being able to chat with second node within single algod container and it running with DEV_MODE env var), i am seeing the following error logs reported by follower:
2023-11-15 00:35:48 {"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).fetchAndWrite","level":"info","line":312,"msg":"fetchAndWrite(14): Aborted while waiting for lookback block to ledger after failing once : wsFetcherClient(127.0.0.1:44360).requestBlock(14): Request failed: requested block is not available","name":"0.0.0.0:10000","time":"2023-11-14T23:35:48.635482Z"}

Which i assume implies that follower node is unable to fetch the data from relay on port 10000 ? The port 10000 is set as a GOSSIP_PORT which i set similarly to your gist at https://gist.github.com/winder/8e167d94817370c8ed2e8579432f9003. Removing this value completely fails on algokit_algod | Error starting deployed network: open /algod/data/algod-listen.net: no such file or directory. What can be root cause for these errors or its just a warning that can be ignored in localnet scenarios (assuming that it seemingly doesn't affect anything)?

  1. Do i need to specify GENESIS_ADDRESS and PEER_ADDRESS env vars on an algod container if both follower and relay are running in a single container? In the gist setup sample https://gist.github.com/winder/8e167d94817370c8ed2e8579432f9003 those are passed explicitly to the follower container but i am unsure whether i need to set them or not in the case of having follower inside first container. Perhaps this is also somehow causing the errors from question 1?
    Archive.zip

If you need any extra context/input please let me know.

@winder
Copy link
Contributor

winder commented Nov 15, 2023

What behavior do you see that is undesirable?

The log you shared is an info level event, so not an error.

@aorumbayev
Copy link
Collaborator Author

aorumbayev commented Nov 15, 2023

@winder aside from compose working the only side effect observed was on our algokit utils unit tests in few places where we get to test app update calls we perform 2 consecutive deploys of a contract. In the case with current v2 indexer, changes are propagated almost instantly so its possible to perform lookup_account_application_by_creator right after app is created (expecting that it will find a freshly minted app id). In case of running against this compose there is still a slight millisecond delay which causes certain tests to fail (since they were assuming that lookup_account_application_by_creator would immediately return app id of a fresh app after txn is submitted and confirmed by algod). But i assume that with v3 indexer (and this compose setup) its expected behaviour given that there is an extra hop for data with extra follower and conduit as middleware. If you can confirm whether its reasonable to expect very short delays for data to propagate from algod to indexer in such localnet scenarios, even when follower node is within the same container then all good.

Other than that would still appreciate a reply for question 2. Just want to ensure i'm not passing any unnecessary environment variables or configurations that can cause unforeseen side effects.

After that will publish the pr and we will do more extensive smoke tests + will require changes in unit tests to account for increased delays on certain tests (that were previously not accounting for the fact that it may take extra time for indexer to sync with changes from algod). CC @robdmoore @neilcampbell

@aorumbayev aorumbayev marked this pull request as ready for review November 15, 2023 16:24
@aorumbayev aorumbayev merged commit 04ef300 into main Nov 22, 2023
3 checks passed
@aorumbayev aorumbayev deleted the localnet_update branch November 22, 2023 13:45
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.

Use official indexer image for localnet
5 participants