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

Add support for RHEL Centos 8 RPM #2190

Merged
merged 18 commits into from
Jun 10, 2021
Merged

Conversation

egieseke
Copy link
Contributor

Summary

Add packaging support for RHEL Centos 8 PRM.

Test Plan

Testing with release pipeline.

@tsachiherman
Copy link
Contributor

Just wondering - why wouldn't the Centos 7 installation work on Centos 8 ?

@onetechnical
Copy link
Contributor

Just wondering - why wouldn't the Centos 7 installation work on Centos 8 ?

Centos 8 has different dependencies (dnf-automatic instead of yum-cron).

@onetechnical
Copy link
Contributor

Just wondering - why wouldn't the Centos 7 installation work on Centos 8 ?

Centos 8 has different dependencies (dnf-automatic instead of yum-cron).

Oh wait, I think I see what you're saying. Can't we just have one RPM that works with both distributions?

@onetechnical
Copy link
Contributor

In answer to my own question, I think the answer is 'no', you can't have a single RPM that supports both distributions based on brief research.

Copy link
Contributor

@onetechnical onetechnical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this looks alright, had some comments.

Also, I'm curious how this will work with repositories. I don't know of a good way to test this.

FROM ${ARCH}/centos:8
ARG GOLANG_VERSION
ARG ARCH="amd64"
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we yum install this but dnf install later? Shouldn't it all be dnf?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it shouldn't actually make a difference, but it wouldn't hurt to switch to dnf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced use of yum with dnf.

FROM centos:8

WORKDIR /root
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, should we dnf everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use dnf.

@@ -0,0 +1,35 @@
ARG ARCH="amd64"

FROM ${ARCH}/centos:8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, but I'm curious if there's a more supported stream image, e.g.:

quay.io/centos/centos:stream8

I don't actually know if that would be better or worse. ¯_(ツ)_/¯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right, i thought we were going to use that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to pull from quay.io/centos/centos:stream8.

@@ -1,3 +1,3 @@
@Library('go-algorand-ci') _
@Library('go-algorand-ci@update-cicd-cachename') _
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed branch.

- name: rpm.centos8
dockerFilePath: docker/build/cicd.centos8.Dockerfile
image: algorand/go-algorand-ci-linux-centos8
version: scripts/configure_dev-deps.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this file still exist? I thought tsachi was removing it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cleared it's content, but kept it around so it won't create build failures.

@bricerisingalgorand
Copy link
Contributor

Assuming it works I think this looks ok to me. It doesn't appear to include publishing to the rpm repo, but I think that's ok for this story

@bricerisingalgorand
Copy link
Contributor

I gave it a tentative approval as long as John's feedback is resolved

@onetechnical
Copy link
Contributor

Assuming it works I think this looks ok to me. It doesn't appear to include publishing to the rpm repo, but I think that's ok for this story

Oh, you know what, I believe we lock in on s3://$PREFIX/algorand-$VERSION-1.x86_64.rpm and s3://$PREFIX/algorand-devtools-$VERSION-1.x86_64.rpm in scripts/release/mule/deploy/rpm/deploy.sh, so we should be fine. I think we'll need to add a story later to add this to repo properly, once we thoroughly test.

egieseke added 2 commits June 9, 2021 16:35
Replaced use of yum with dnf.
Removed reference to go-algorand-ci branch.
onetechnical
onetechnical previously approved these changes Jun 9, 2021
Copy link
Contributor

@onetechnical onetechnical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided this passes testing, I'm okay with this.

@@ -105,6 +105,7 @@ fi

sudo usermod -a -G docker ubuntu
sg docker "docker pull centos:7"
sg docker "docker pull centos:8"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to replace this with the stream image, but not really a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to pull quay.io/centos/centos:stream8.

@onetechnical
Copy link
Contributor

This PR is still in draft mode, though.

@egieseke egieseke marked this pull request as ready for review June 9, 2021 22:06
@codecov-commenter
Copy link

Codecov Report

Merging #2190 (9361c2d) into master (06faea5) will increase coverage by 0.75%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2190      +/-   ##
==========================================
+ Coverage   45.95%   46.70%   +0.75%     
==========================================
  Files         350      344       -6     
  Lines       57780    55215    -2565     
==========================================
- Hits        26550    25786     -764     
+ Misses      28161    26502    -1659     
+ Partials     3069     2927     -142     
Impacted Files Coverage Δ
catchup/peerSelector.go 98.90% <0.00%> (-1.10%) ⬇️
ledger/applications.go 67.16% <0.00%> (-1.02%) ⬇️
ledger/cow.go 90.21% <0.00%> (-0.49%) ⬇️
data/transactions/logic/eval.go 92.26% <0.00%> (-0.33%) ⬇️
ledger/eval.go 76.38% <0.00%> (-0.31%) ⬇️
network/wsNetwork.go 60.57% <0.00%> (-0.29%) ⬇️
ledger/acctupdates.go 61.83% <0.00%> (-0.09%) ⬇️
data/transactions/logic/opcodes.go 100.00% <0.00%> (ø)
auction/logic.go
auction/serializedLogic.go
... and 17 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 06faea5...9361c2d. Read the comment docs.

Copy link
Contributor

@onetechnical onetechnical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still looks fine to me, though I'd like to see it exercised to verify it works.

@algobarb
Copy link
Contributor

Approved. Good work incorporating all the other suggestions!

@algojohnlee algojohnlee merged commit 61dfa87 into algorand:master Jun 10, 2021
tsachiherman pushed a commit to tsachiherman/go-algorand that referenced this pull request Jul 7, 2021
algochoi added a commit to algochoi/go-algorand that referenced this pull request May 28, 2022
* Update the Version, BuildNumber, genesistimestamp.data

* testing: fix TestRekeyUpgrade when round=0 (algorand#2188)

The previous fix for this test (algorand#2178) was incomplete. It did not included proper handling for the case of round 0.
This PR addresses this corner case.

* Improve fresh node startup time (algorand#2185)

## Summary

This PR contains three different changes that would allow the node to start up faster:
1. It disables the block 0 fix we previously deployed. This fix was intended to address catching up archival nodes, where we would calculate the block 0 hash incorrectly. The fix was long deployed, and the hash calculation is also fixed since.
2. The tracker and blocks databases are now being opened concurrently.
3. The accounts tracker database schema upgrade would now skip some of the steps that aren't required for a fresh database.

Combining all the above, the ledger startup of a new node is now about 2-3 times faster.

## Test Plan

This change has no functional enduser change. The existing tests provide sufficient coverage.

* PeerSelector and Catchup service tests (algorand#2184)

Unit tests to improve the test code coverage in peerSelector and catchup/service
peerSelector.go 100% coverage
catchup/service.go ~69%

* Adding missing test for universalFetcher.go (algorand#2175)

Adding missing test for universalFetcher.go

Code coverage increased from 74%->96%

* testing: fix data race accessing messagesOfInterest during network shutdown (algorand#2181)

<!--
Thanks for submitting a pull request! We appreciate the time and effort you spent to get this far.

If you haven't already, please make sure that you've reviewed the CONTRIBUTING guide:
https://github.com/algorand/go-algorand/blob/master/CONTRIBUTING.md#code-guidelines

In particular ensure that you've run the following:
* make generate
* make sanity (which runs make fmt, make lint, make fix and make vet)

It is also a good idea to run tests:
* make test
* make integration
-->

## Summary

Fix race [reported here](https://github.com/algorand/go-algorand-internal/issues/1268):
```
Read at 0x00c00675ed48 by goroutine 210:
  github.com/algorand/go-algorand/network.(*WebsocketNetwork).ServeHTTP()
      /home/travis/gopath/src/github.com/algorand/go-algorand/network/wsNetwork.go:1114 +0x19ad
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /home/travis/gopath/pkg/mod/github.com/gorilla/[email protected]/mux.go:162 +0x193
  github.com/algorand/go-algorand/network.(*RequestTracker).ServeHTTP()
      /home/travis/gopath/src/github.com/algorand/go-algorand/network/requestTracker.go:474 +0x77b
  net/http.serverHandler.ServeHTTP()
      /home/travis/.gimme/versions/go1.14.7.linux.amd64/src/net/http/server.go:2836 +0xce
  net/http.(*conn).serve()
      /home/travis/.gimme/versions/go1.14.7.linux.amd64/src/net/http/server.go:1924 +0x837
Previous write at 0x00c00675ed48 by goroutine 79:
  github.com/algorand/go-algorand/network.(*WebsocketNetwork).Stop()
      /home/travis/gopath/src/github.com/algorand/go-algorand/network/wsNetwork.go:855 +0x265
  github.com/algorand/go-algorand/network.TestGetPeers()
      /home/travis/gopath/src/github.com/algorand/go-algorand/network/wsNetwork_test.go:977 +0xe1d
  testing.tRunner()
      /home/travis/.gimme/versions/go1.14.7.linux.amd64/src/testing/testing.go:1039 +0x1eb

```

## Test Plan

The CI should run this test. I don't think the flaky test runs on pull requests right now, but it should run during the nightly builds. 

The race is not reproducible on my system. Running this before and after the test does not report any errors (until a 10 minute timeout):
```
$ gotestsum --format testname -- -tags "sqlite_unlock_notify sqlite_omit_load_extension osusergo netgo static_build" -race github.com/algorand/go-algorand/network -run TestGetPeers -count 1000000000
```

* Add mention of install_buildtools.sh to README (algorand#2195)

Recently the build tooling was updated in algorand#2108 which split out the installation of Go tools golint, stringer, swagger, msgp into a separate script install_buildtools.sh. This updates the README to reflect that in the environment setup instructions.

* Remove buildnumber.dat and genesistimestamp.dat files.

* run some independent commands in parallel, total test 230s -> 170s (algorand#2197)

run some independent commands in parallel, total test 230s -> 170s
`20210526_115456 :179 finished e2e_subs/sectok-app.sh OK in 235.471021 seconds`
down to
`20210526_122739 :179 finished e2e_subs/sectok-app.sh OK in 169.771514 seconds`

* Update version.go

* testing: e2e sub assets-app speedup (algorand#2198)

Optimize assets-app test

* Clean up `goal wallet new` output (algorand#2183)

When you run goal wallet new there is a confusing warning ("One or more non-printable characters ...") presented just before the backup phrase, which is displayed between some sanitized ANSI codes. This is due to security improvements in algorand#1585 to prevent goal from printing control characters. This PR removes the ANSI color formatting altogether from the infoBackupPhrase (already done for Windows in algorand#1942), which is one simple way to clean up this output and remove the warning message.

* testing: fix bug in TestApplicationsUpgradeOverREST (algorand#2196)

The TestApplicationsUpgradeOverREST e2e had a bug in the testing code -
if the upgrade takes place before the broadcast takes place, the broadcast result could be non-err.
This PR ensures that if we get a non-error, we have already upgraded.

* debug tools: improve carpenter by adding timestamp (algorand#2207)

debug tools: improve carpenter by adding timestamp

* Improve testing predicate to provide better info in case of a fail case. (algorand#2206)

The e2e test TestRewardUnitThreshold was failing on this statement:
```golang
r.Truef(latestBalanceNewAccount.PendingRewards >= (initialBalanceNewAccount+amountRichAccountPokesWith)/rewardUnit, "new account should have pending rewards (e2e)")
```

I replaces the `r.Truef` with `r.GreaterOrEqualf` to get the values off when it fails.
( I wan't able to reproduce it, so I figured getting some extra info for the next time would be helpful )

* Re-enable gofmt check during travis build (algorand#2212)

While talking to @tsachiherman we noticed stray fmt'd files in my repo after running make sanity, and he suggested submitting a fix PR. I discovered this shell line generated a list of gofiles that is always empty, probably because the way we set up builds for branches (and vendoring) has changed since it was written.

* A test recommendended by Pavel, an imporvment rec'd by Brian (algorand#2216)

Two small improvements recommended during CR of teal4-math

* "Rent" larger program size (algorand#2157)

Allow paying for more program space.

* Access values from a previous app call's scratch space (algorand#2158)

This change allows contract to contract composability by allowing future app call transactions to read the scratch space of previous transactions. This allows smart contracts to expose side effects for future application calls, such as a price oracle returning the exchange rate of a particular asset pair.

Changes include:

Adding PastSideEffects fields to EvalParams.
gload and gloads docs.

* Refresh wallet handle after waiting for series of rounds, as handle might expire. (algorand#2203)

Refresh wallet handle after waiting for series of rounds, as handle might expire

* Fix proposal propagation (algorand#2079)

When a relay receives a proposal for a future round, the proposal fails to be relayed. This change fixes that by sending it when the agreement advances to the corresponding round.

* Correct path to genesis file in nightly perf testing (algorand#2218)

Fix issue cp: cannot create regular file 'gen/devnet/genesis.json': No such file or directory by creating a directory if it doesn't exist to store the genesis file. Changed the reference genesis.json file to installer/genesis/ path.

* pool fees in a txgroup (algorand#2173)

A fair amount of complexity is introduced in transaction groups when the goal is to let some entity perform an action at the expense of another. For example, a contract account might be willing to perform an exchange, but expects the caller to compensate it to replace the fee that the contract account must pay.

This changes fee accounting to simplify these situations. Rather than check that each txn in a txn group meets the min fee, the txgroup is checked as a whole to ensure the total fee exceeds n*min_fee for an n member txgroup.

* Fixing a bug in eval and TestOnSwitchToUnSupportedProtocol (algorand#2220)

estOnSwitchToUnSupportedProtocol had multiple segments. This test is separated into multiple tests.

This PR fixes two issues:

Fix for a bug in eval: in the event of an error and early termination of the eval, the loading of accounts in a separate go routine was not terminated. loadAccounts will be terminated when eval returns.
TestOnSwitchToUnSupportedProtocol1 had a bug in setting the blocks for protocol switch. The first block was not getting the NextProtocolSwitchOn set to 1. Despite the bug, the test was passing most of the time, and failing some of the time.
TestOnSwitchToUnSupportedProtocol3 had a bug in setting the blocks for protocol switch. AddBlocks starts adding from the next round of the passed block. NextProtocolSwitchOn was getting set one round late.

* Extend catchpoint wait for round timeout from 10 to 60 milliseconds. (algorand#2231)

Extend catchpoint test next round timeout from 10 to 60 seconds to try to avoid test failure.

* bandwidth stats for cluster tests (algorand#2159)

heapWatch.py gains the ability to get a list of hosts from terraform-inventory from algonet tool. Can have --token and --admin-token set for talking to those cluster algod instances. (Cluster tool is separately updated to set one token across all cluster algod.)

metrics_delta.py processes captured /metrics data into stats for each algod followed and also produces one summary line of all data processed, e.g.:
summary: 1091.99 TPS, 26341397 tx B/s, 3490256 rx B/s

* Check setbyte length properly. (algorand#2236)

We we checking the against the length with > instead of >=.  That's
wrong, so we could cause a panic instead of clean error when trying to
set the byte 1 past the array length.  Fortunately, both have the same
effect: the txn fails. But we should do this properly.  Thanks to
@amityadav0 for the report in algorand#2221.

* Use minimal travis container since we install go ourselves. (algorand#2232)

Since we manage go ourselves I want to see if our build works without running the travis go setup step.

* Modify build_release to match build_pr and remove ARM Deploy. (algorand#2237)

This pulls in the cleanups we've made to other testing into the rel/
tests. Additionally, the ARM Deploy builder has not successfully built
in a while, so we'll remove it altogether.

* Fix rel nightly test by extending catchpoint round timeout (algorand#2240)

Fix catchpoint unit test by extending timeout from 10 to 60 seconds.

* Fix the two docker files - avoid make deps step, which is no longer needed. (algorand#2241)

Fix the two docker files - avoid make deps step, which is no longer needed.
The compilation of go-algorand no longer requires the installation ( and therefore the validation ) of the dependencies.

* Use gotestsum instead of logfilter for test formatting. (algorand#2161)

Use `gotestsum` to format go test output, include duration messages in a few spots that take up some time, simplify some small things here and there.

* Ensures that the catchup service have the network library load the DNS records before attempting the first sync. (algorand#2248)

Ensures that the catchup service have the network library load the DNS records before attempting the first sync -

Current code was attempting to sync without any DNS records available, failing, and trying again later on. Since the DNS records were being refreshed every 60 seconds, the third or fourth attempt would be successful. This PR attempt to give the catchup service a good chance of succeeding on the first attempt.

* Combine Clear and Approval Program size limits (algorand#2225)

Apps have been able to use 1k space for each of their programs since apps were introduced in v24. But clear state programs are quite small. It is more useful to provide 2k of space, divided however the app prefers. This PR does that, including giving 2k extra space for each unit of "extra pages" requested at app creation time.

Tests considering before and after consensus updates.

* Remove ci-deps and update GOPROXY in Dockerfiles (algorand#2247)

Recent refactoring has changed dependency installation. ci-deps did not appear to be used in a meaningful way, so it was removed from the Makefile and Dockerfiles. Additionally, downloading from go has become unstable, so updating the GOPROXY options should help.

* codecov integration (algorand#2228)

Integrate with codecov.io to attach coverage reports to PRs

* Disable compact certs and auction tests (algorand#2254)

They need work and shouldn't block our releases since they features aren't currently in use/enabled.

* If the branch is rel/nightly set channel to nightly (algorand#2252)

The way that the new pipeline scripts computed channel did not account for the rel/nightly branch, which should set the channel to nightly. This was preventing rpm and deb binaries from being built. This change identifies if the TRAVIS_BRANCH env is set to rel/nightly, and if so, will set the channel to nightly.

* Optimize constant assembly (algorand#2215)

With this PR, constants introduced by pseudo-ops (int, byte, addr) are now placed into constant blocks or loaded with pushint/pushbytes in the optimal way to save program space, starting with TEAL v4.

This optimization effectively reorders the intcblock and bytecblock that the assembler creates for pseudo-op constants such that the most frequently referenced constants are first (and can thereby take advantage of the space-saving intc_X/bytec_X opcodes). Additionally, any constants referenced only once are taken out of the constant block and instead loaded with pushint or pushbytes to further save space.

Other changes:

Renamed OpStream's noIntcBlock and noBytecBlock to hasIntcBlock and hasBytecBlock to clarify this flag is true only if the input code defines a constant block.
pushbytes now disassembles with a comment containing a parsed representation of its contents, like bytec.

* combine app state key/value size limits (algorand#2172)

Combine the limits enforced on keys and values in Teal such that there is a 128 byte limit on a key/value pair, rather than a 64 byte limit on each. The previous method meant app creators/users were essentially paying for ("renting") space that might be used by keys, but rarely was, and even if it was, could serve little purpose.

* Catchupaccessor coverage (algorand#2235)

testing: improve Catchupaccessor code coverage

* Expose creatable IDs to TEAL code within the same group (algorand#2243)

This PR adds gaid and gaids opcodes (similar to gtxn and gtxns), which will allow smart contracts to access asset IDs of assets/apps which were created earlier in the same transaction group.

Previously, accessing creatable IDs required subsequent app calls with asset/application IDs as app arguments.

* Allow AVM code to access a max number of foreign refs. (algorand#2263)

Along the lines of similar "combine" PRs, this allows AVM code to access a total number of "foreign" references, as opposed to limiting each one individually.

* deprecate auction code (algorand#2261)

RIP Auction code. We should create a tag when this is merged. It is also archived in https://github.com/algorand/auction-tools

* wrote tests

* Temporarily disabled TestBasicCatchpointCatchup and reset test timeouts from 60 to 10 seconds. (algorand#2266)

* Add support for RHEL Centos 8 RPM  (algorand#2190)

* lint

* Disable TestPeriodicSync test (algorand#2269)

Temporarily disable TestPeriodicSync test since it is broken and blocking the release pipeline.

* Fix incorrect `gaid` and `gaids` docs (algorand#2275)

The gaid and gaids docs refer to the deprecated CreatableID transaction field that was used by the txn opcode. This PR fixes the documentation and adds additional information about only being able to access IDs of previous transactions in the current group.

* Regularize access to "foreign" references. (algorand#2264)

All opcodes that take accounts, asas, or apps can use the thing itself (an address, or asa/app id) or an "indirect" reference through the "foreign" arrays of the app transaction. In all cases, the "thing" must appear in those foreign arrays, it's just more convenient sometimes to use the item in code, rather than indirect. (Note this is a new requirement for some opcodes that previously allowed access to any number of local state objects of an account asset_holding_get asset_opted_in and app_local_*)

* fix random failure (algorand#2280)

The unit test had a corner case that would not ensure that all the rounds were flushed to disk.

* Make account endpoint produce deterministic output (algorand#2276)

The JSON return value of the /v2/accounts/{addr} endpoint represents an account with several arrays which are populated from Go maps (such as held assets, created apps, etc.). Currently these arrays are unordered, meaning every time you query this endpoint, you'll likely receive a response with a different ordering of these arrays. This makes SDK testing more difficult than it needs to be, since different responses cannot be directly compared to each other.

This PR sorts the slices in generated.Account so that the /v2/accounts/{addr} endpoint will always produce arrays with deterministic order.

* In this chage, fixes to peer selector and the test.

peerSelector.go: various bug fixes
- introduce peerSelectorPeer to wrap the network.Peer and add peerClass information, to be able to distinguish between peers of the same address but different classes.
- keep track of download failures to be able to increase the cost of each failure when failing more than succeeding. This is to evict the peer faster when constantly failing to download.
- initialize rankSum and rankSamples to initialRank of the class. Otherwise, the peer rank will have a very long warmup time before relfecting the correct rank.
- let resetRequestPenalty bound the rank within the class bounds. Otherwise, the penalty calculation pushes the rank out of the class bounds (bug).
- getNextPeer is local to the package
- getNextPeer, PeerDownloadDurationToRank and RankPeer use peerSelectorPeer instead of network.Peer
- refreshAvailablePeers distinguishes between peers with the same address but of different peer class
- findPeer returns the peer given the address and the peer class (instead of just the address)

catchpointCatchup_test.go:
- Remove comment about giving the second node all the stake, since it is not the case here.
- Use the round from the catchpoint instead of guessing the round as 36. In case the following catchpoint was obtained due to race conditions, checking for round 37 will be trivial, since it will also be obtained from the catchpoint.

catchpointService.go and service.go:
- Update the code to use peerSelectorPeer instead of network.Peer with peerSelector

peerSelector_test.go:
- Update the tests to use peerSelectorPeer instead of network.Peer with peerSelector
- Cleanup debugging printouts.

* write tests

* fix import

* rename test

* Added tests, exponential increase of download failure impact, local functions.

* test for error first

* Fix the test name so it runs

* final v28 foundation spec (algorand#2286)

Changes to readmes and specs to reflect the matching foundation spec.

* fix tests

* report substring missing immediates properly (algorand#2287)

Fixes crash that should be a clean error report for using substring wrong.

Unit tests added to confirm and prevent regression.

* add check

* Fix darwin-arm64 builds

* address comments

* Enable unit tests on mac build script.

* More changes.

* Introduce V28 consensus version (algorand#2255)

* TEAL v4
* Larger programs
* Larger app/asset lookup limits
* Longer asset URL
* Fee pooling within a group
* Keyreg txn additional checks

Removed InitialRewardsRateCalculation and PaysetCommit from vFuture since it is already in v26

Fixed some tests after exposing zero fees and strict keyreg as current consensus

* Forgot to run .md generation (algorand#2292)

* add another case

* Allow fee to be below minfee, if given explicitly. (algorand#2295)

This makes other txns accept explicitly low fees.  Sorry for the code
duplication, but I did not want to change libgoal's existing behavior
where it increases fee to minfee.

* Expose extra program pages to API (algorand#2294)

Add the AppsTotalExtraPages account field to the response returned by the /v2/accounts/{addr} endpoint.

* use enums for message event permutations, add require trace helpers

* add playerPermutation enums to permutation test

* rename requireTraceContainsAction to requireTraceContains

* testing: fix random failure in TestAppEmptyAccountsLocal (algorand#2302)

The test had two unrelated bugs:
1. We need to call `WaitForCommit` before `reloadLedger` to ensure the block is being written to disk before the blockQ getting reinitialized ( and loose its content ).
2. The calculation of the total rewards unit in `makeNewEmptyBlock` was wrong. I corrected it. For tests that run only one or two rounds, this might be good enough, but for long-running tests, it would start fail pretty quickly.

* Update the Version, BuildNumber, genesistimestamp.data

* make linter happy by removing underscores from enum names

* Remove commented code in TestPlayerPermutation

* Move extra page test to e2e_subs

* Specify truncated division is used in TEAL

Specify that the truncated division is used (https://en.wikipedia.org/wiki/Modulo_operation#Variants_of_the_definition)

* typos, grammar, inconsistencies

mostly casing issues, ie, algorand > Algorand || sqlite > SQLite

* Spec updates to go with division explanation.

* added benchmark to lruAccounts write function

* lruaccounts benchmark: filling the acounts with data before benchmarking

* fix: amount of accounts generated in lruAccounts write benchmark

* lruAccounts write fix: benchmark used too much memory

* lruAccounts benchmark: a more controlled distribution between accounts in the benchmark

* REST API: make extra-program-pages and apps-total-extra-pages optional

* This also helps in not exposing them before the protocol switch

* Merge pull request algorand#2313 from algorandskiy/pavel/extra-pages-api

REST API: make extra-program-pages and apps-total-extra-pages optional

* Bump buildnumber.dat

* Run misspell linter with -w flag (algorand#2320)

This runs the popular misspell linter with the -w flag to automatically correct spelling mistakes in go-algorand.

* Reduce unneeded contention around checking the peers connectivity. (algorand#2319)

Existing `messageHandlerThread` was checking that all the connected peers are properly communicating by examining their recent message timings. This implementation served us well - however, it was executed redundantly. How much redundantly ? 19 times too many every 3 minutes ( and all of them at the **exact** same time.. ).

This PR ensures that all the `messageHandlerThread` shares the same ticker for testing the `checkPeersConnectivity`. This is expected to reduce the pressure on the internal `peersLock`.

* Improve TestMetricSegment test realibility (algorand#2322)

mprove TestMetricSegment test reliability by repeating the test with incrementing time delays.
This implementation would allow faster execution on faster platforms, and allow fallback for slower platforms.

* Restore TestPeriodicSync and TestBasicCatchpointCatchup tests. (algorand#2315)

* testing: enable previously disabled TestConfigMigrate unit test (algorand#2326)

testing: enable previously disabled TestConfigMigrate unit test

* testing: fix gotestsum install (algorand#2328)

testing: fix gotestsum install

avoid installing swagger when not needed.

* testing: move travis_retry to skip rebuilding (algorand#2324)

Remove the top-level retry command. This will allow build / lint failures to terminate the build with no retry, and may speed up test failure retries.

* testing: fix telemetry unit tests (algorand#2321)

Fix and re-enable async telemetry unit test TestAsyncTelemetryHook_CloseDrop.

* Add Fedora support into install_linux_deps.sh (algorand#2331)

Add Fedora deps into install_linux_deps.sh

* Add missing txna allowed args to doc and langspec (algorand#2336)

We exposed Assets and Applications in TEAL v3 but did not update doc/langspec. This commit fixes it.

* Add initial devMode support (algorand#2334)

Add new local private network mode - devmode. devMode allows the developer to deploy a single node network, where every transaction being sent to the node automatically generates a new block.

This feature is focused primarily around 3rd parties that want to test their solution on the Algorand platform, without waiting for the network to make progress.

* Implement hello circleci yaml (algorand#2417)

This adds a hello world circleci yaml. This can be used to run circleci jobs on PRs until the pipeline is fully implemented.

* catchup: fix potential nil dereferencing (algorand#2420)

The handing for returned peer was incorrect in case the getPeerErr is non-nil, as we would attempt to dereference the nil pointer.

* testing: ensure deploy_linux_version generates a linux/amd64 binaries for algonet usage (algorand#2422)

The deploy_linux_version.sh script currently creates a linux version of the current project tree with the same architecture as the hosting environment.

When we attempt to builds on M1 Macs, it default to arm64 base images and as a result - makes a linux/arm64 compatible binaries. These resulting binaries, however, would not work correctly on an algonet deployed network, since the hosts there are amd64.

To rectify that situation, we'll be changing the docker file to ensure linux/amd64 binaries are generated. This would ensure that the existing functionality works as intended. In the future, when we would add arm64 support for algonet, we could accompany that by creating corresponding images on docker as well.

* Specs and unit test to avoid forgetting in the future (algorand#2418)

Specs and unit test to avoid forgetting in the future

* Fix and enable TestNewAccountCanGoOnlineAndParticipate (algorand#2238)

* TestNewAccountCanGoOnlineAndParticipate was failing because the test was
not waiting enough to get to the round where the newly funded account's
funds will be considered for proposing purposes.

It was miscalculating the round that it should wait form.

Moreover, the rounds considered to when the account is funded was prone to
race conditions.

In addition, the test was using WaitForRoundWithTimeout which may be
very slower if the current round is already ahead. Instead, now it is
using ClientWaitForRound, which does not care about individual rounds delayed.

* Addressing review commnets:
- fixing a typo
- getting exact transaction round for funding the account
- testing exact blocks for the proposer
- using a single node network instead of two nodes
- waiting for exactly one round for the new account to propose and checking that
- sending the funds and closing the rich account so there will be no possiblity of that proposing a block

* Fix docker repo update (algorand#2342)

The scripts to update the docker repository do not do a full rebuild, and the submitted Dockerfile does not change. This means that if you run the docker image/repo update, it'll re-use the old image. To fix this, we call docker build with --no-cache. Other refactoring helps simplify the code.

We add a new --cached flag to the docker/releases/build_releases.sh script to explicitly cache. Otherwise the testnet update would issue a full rebuild. We additionally automatically handle the 'latest' tagging in build_releases.sh as well.

* Bump Version, Remove buildnumber.dat and genesistimestamp.dat files.

* Initialize past side effects with correct length during dryrun requests (algorand#2448)

This PR fixes a typo in the dryrun code that caused certain dryrun requests containing multiple transactions to fail.

* optimize txtail memory consumption (algorand#2413)

The changes in this PR are as follows:

The unused method Ledger. GetRoundTxIds was removed. As a result, the txTail. getRoundTxIds can be removed as well. This makes the txids map stored in the roundTxMembers structure redundant.
In the cow.go, avoid adding empty leases to the cb.mods.Txleases map. Since we already not testing for empty leases, we can safely avoid storing them.
Optimize the txTail. loadFromDisk to generate optimal lastValid map sizes.
Optimize the txTail. loadFromDisk to avoid storing empty leases in the txleases map.

* enable TestPartkeyOnlyRewards on macos (algorand#2429)

TestPartkeyOnlyRewards was disabled on darwin.
It is no longer failing on darwin (5/5 runs passed).

* Fix 10 minute timeout in travis. (Revert parts of algorand#2324) (algorand#2494)

We started seeing the 10-minute timeout error on travis after the recent changes to where travis_retry gets called.

This means travis_wait is still needed. travis_wait and travis_retry don't play well together on the ephemeral build machine, so we basically need to rollback the entire change in algorand#2324

Note: while making this change I noticed that we don't use travis_retry for all of the build_test.sh / integration_test.sh entries. Not sure why but I left them as they were before algorand#2324

* allow to parse ipv6 localhost "[::]:4601" (algorand#2430)

Allow parsing of ipv6 localhost -colon- port address.
"[::]:4601" was failing to parse. This and other forms pass ParseHostOrURL() now.

* disable TestAgreementSynchronous10 (algorand#2503)

The test TestAgreementSynchronous10 is failing. We should be fixing it, but until we do that, I'm going to disable it so it won't mask other issues.

* testing: avoid division by zero during TestBasicCatchpointWriter (algorand#2502)

The `randomFullAccountData` method was dividing by `lastCreatableID` which could be zero.
The probability for that is pretty slim, but given that it was found during a travis run, we should fix it.

* selector pseudo-op in support of ABI (algorand#2358)

Adds a Teal pseudo-op `selector` that assembles as if it were the `byte` pseudo-op, but stores 4 bytes of hash.

This allows Teal, like:
```
txn ApplicationArgs 0
selector "add(uint64,uint64)uint128"
==
bnz add
```

and avoid the need to embed the actual hash in a .teal file (which would also require calculating it)

Unlike `byte`, the argument *must* be a quoted string - no base64 or hex allowed, as the argument should be a method signature.

* Creator access and app_params_get (algorand#2301)

Adds the ability to get the creator of apps and assets in teal.

This is a simple new field for `asset_params_get`, but it introduces a new opcode `app_params_get` to enable access for apps.  Meanwhile `app_params_get` allows access to other global parameters about an app - the schema sizes, extra pages, and the programs themselves.

This also begins work on LogicVersion=5, which should be AVM 1.0

* fix regex for matching charset of valid DNS hosts, add test (algorand#2505)

A regex was trying to match valid DNS names but missed the '-' char. Fix.

* Fix random failure in TestWebsocketNetworkPrioLimit (algorand#2509)

The peers array is modified when adding/removing entries from it. When that does happen, we increase the peersChangeCounter, so that the broadcast method would know that it's peers list need to be refreshed.
The said update was missing from prioTracker.setPriority, which was causing the issue.

* Make TestPeersDownloadFailed and TestHistoricData predictable (algorand#2516)

Both the `TestPeersDownloadFailed` as well as `TestHistoricData` were randomly failing, as they were depending on a "genuine" random distribution of the random function in order to succeed. When that doesn't happen, they were failing.

This PR make sure to "bake-in" the random seed so that the tests are repeatable and a success is repeatable as well.

* Improve testing of alloc bounded slices. (algorand#2515)

This change is needed in order to support codec types such as the following:
```golang
//msgp:allocbound typeA 16
type typeA []typeB
```
since we want the codec object randomizer to recognize that `typeA` has a allocbound defined, and use that bound.
( this would be used in the feature/txnsync branch, but the change doesn't really related to any of the other changes in the feature/txnsync branch and would be a good change regardless )

* Save Logging Information in Data Directory If Provided (algorand#2415)

Our logic should be as follows:

When Loading:

We first look inside the provided data-directory. If a config file is there, load it and return it
Otherwise, look in the global directory. If a config file is there, load it and return it.
When Saving:

If a data-directory was provided then save the config file there.
Otherwise, save the config file in the global directory

* Lruaccts write speedup (algorand#2329)

Optimized lruAccounts write function. gains: from ~260ns to ~200ns per write op

* Use golangci-lint (algorand#2523)

This adds a golangci-lint configuration file that runs an initial minimal set of linters: golint, govet, and misspell. This makes it easier to integrate with editors and IDEs and also opens the door to using from CI.

* update codec tester (algorand#2527)

This PR improves the checkBoundsLimitingTag method of the message pack random generated object tester.
With this change, we're no longer ignoring data types that has no struct tags, but rather looking for corresponding msgp directives.

This is the same change applied to the feature/txnsync branch. This change is expected to be nop on the master branch, but would be required on the feature branch.

* Fix random failures in TestPeriodicSync (algorand#2535)

The waiting period wasn't long enough. Allow much longer wait period before giving up.

Also - omit unneeded log entries.

* Testing: use periodicSyncLogger for cleaner test runs (algorand#2539)

Use periodicSyncLogger in a test to avoid unnecessary log outputs.

* Add travis wait to compilation step on travis. (algorand#2544)

Travis nightly build failed due to no-output for over 10m from build process.

* test conditional slack alert (algorand#2537)

Travis is currently unable to only notify on failures of a particular branch, however, it can notify on us on the build of a particular branch (both success and failures). Since we are also considering CircleCI, I think it would be best to just add the slack notification into the travis file now for the rel/nightly branch and notify the #devops-jenkins channel (where most of our jobs status activity goes) when it both succeeds/fails. The "successes" will also help us determine whether or not the test ran at all.

* Add Extract opcodes  (algorand#2521)

Adds extract opcodes that allow a substring to be extracted given a start index and a length (algorand#2347).

The specs for the extract and extract3 opcodes are the same as the substring and substring3 opcodes, but takes a length rather than an end index. This also adds extract16bits, extract32bits, extract64bits which extracts 2, 4, and 8 byte strings respectively and converts them into integers.

* Benchmark

* Modify target

Co-authored-by: DevOps Service <[email protected]>
Co-authored-by: John Lee <[email protected]>
Co-authored-by: Tsachi Herman <[email protected]>
Co-authored-by: algonautshant <[email protected]>
Co-authored-by: Will Winder <[email protected]>
Co-authored-by: chris erway <[email protected]>
Co-authored-by: Brian Olson <[email protected]>
Co-authored-by: algobarb <[email protected]>
Co-authored-by: John Jannotti <[email protected]>
Co-authored-by: shiqizng <[email protected]>
Co-authored-by: Jacob Daitzman <[email protected]>
Co-authored-by: nicholasguoalgorand <[email protected]>
Co-authored-by: egieseke <[email protected]>
Co-authored-by: John Lee <[email protected]>
Co-authored-by: bricerisingalgorand <[email protected]>
Co-authored-by: Jason Paulos <[email protected]>
Co-authored-by: Jacob Daitzman <[email protected]>
Co-authored-by: Nicholas Guo <[email protected]>
Co-authored-by: algonautshant <[email protected]>
Co-authored-by: Rakshith Gopala Krishna <[email protected]>
Co-authored-by: Pavel Zbitskiy <[email protected]>
Co-authored-by: chris erway <[email protected]>
Co-authored-by: Pavel Zbitskiy <[email protected]>
Co-authored-by: Fabrice Benhamouda <[email protected]>
Co-authored-by: figurestudios <[email protected]>
Co-authored-by: John Jannotti <[email protected]>
Co-authored-by: Jonathan Weiss <[email protected]>
Co-authored-by: Jonathan Weiss <[email protected]>
Co-authored-by: algonathan <[email protected]>
Co-authored-by: pzbitskiy <[email protected]>
Co-authored-by: AlgoStephenAkiki <[email protected]>
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