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

Feature/c2c temp #3392

Merged
merged 78 commits into from
Jan 7, 2022
Merged

Feature/c2c temp #3392

merged 78 commits into from
Jan 7, 2022

Conversation

jannotti
Copy link
Contributor

@jannotti jannotti commented Jan 7, 2022

Summary

Test Plan

Algo-devops-service and others added 30 commits November 18, 2021 22:10
* Implement transactions as arguments

* Fix indexing and dryrun issue

* Add docstring

* Satisfy review dog

* Fix pointer issue

* Fix group command

* Rename e2e test

* Fix filename variable

* Add e2e test

* Use tab
## Summary

Small change: libboost-math-dev requires just 4 packages to install, while libboost-all-dev requires > 100. Only Debian/Ubuntu distributions provide fine-grained boost packages like this, but should shave a little time off the CI builds. (Our only boost include is boost/math/distributions/binomial.hpp.)

## Test Plan

Builds should pass as before. Now that we are no longer using Travis for Linux builds, the side effect of libboost-all-dev installing make and other missing build tools on Travis encountered in #2717 is no longer a concern.
## Summary

- Test to make sure RES has the right input before counting line numbers for result size.
- Rest RES to empty so that the same output is not recycled in case of an error.
- exit 1 in case of an error
- Reduce LAST_ROUND from 1200000 to 120
- "Get List of Keys" before getting NUM_IDS_3 otherwise it will recycle old RES value.

## Summary
Some e2e tests require a python environment for testing.
Unfortunately, setting up that environment adequately similar to the testing environment may not be trivial.
This change introduces an interactive mode to the e2e.sh script which stops at the point of running the tests, and allows the user to run the tests from the same testing environment.


## Test Plan
No tests needed. Tested the script locally.
## Summary

Fix a couple flaws in the new go-e2e tests built ontop of DevMode:
* Shutdown the fixture when finished.
* Don't run in parallel.
* Longer delays / better algorithms to wait for data flushing to complete.
* Check for "out of order" keys.

## Test Plan

N/A, this is a test.
## Summary

The sandbox is not building with dev config using master branch algorand/sandbox#85, complains about libtool not being installed

Guessing from this change #3223 

Adding libtool to UBUNTU_DEPS in install scripts

## Test Plan

Set config in sandbox to my branch
`sandbox up dev`
It built
## Summary

Error from account preloading was shadowed by returning a wrong err variable. This caused subsequent problems in account updates and masked the original failure.

## Test Plan

Use existing tests
## Summary

This test doesn't work properly, disable it until #3255 addresses any underlying problems.
## Summary

A test helper function `commitRound` accessed `l.trackers.lastFlushTime` without taking a lock. Fixed.

## Test Plan

```
go test ./ledger -run TestAppEmpty -race -count=50
ok      github.com/algorand/go-algorand/ledger  4.078s
```
## Summary

Fix e2e.sh mixed indent characters.
## Summary

Fix a small type discrepancy in the OpenAPI spec ahead of some other work that's about to happen.
## Summary

This sets `-p 1` for the e2e-go tests, intended to make them more deterministic when running on a VM with relatively constrained resources. Since each e2e-go test might spin up a few nodes, it seems like it would help to avoid resource contention.

## Test Plan

Tests should run as before. Desired effect can be verified by looking at the test output where the value of PARALLEL_FLAG is printed out before tests are run.
Add Custom Scenario for Performance Testing.
Add README on how to run custom scenario and modify create_and_deploy_recipe.sh to accept a network template that will generate a new recipe.
## Summary

Add ParticipationRegistry methods for setting and retrieving state proof keys. Since they aren't in master yet there is a `type StateProofKey []byte` stub which will need to be updated later.
 
## Test Plan

New unit tests.
b64 opcode, tests, and specs
Upgrading to 1.16 to help alleviate issues with working on different go versions, and update to a supported, more secure version.
Release notes for Go 1.15 and 1.16:
https://tip.golang.org/doc/go1.16
https://tip.golang.org/doc/go1.15
## 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
}
```
## Summary

This test (TestEcdsa) tests the ecdsa_pk_decompress opcode and intentionally "tampers" with the public key by setting the first byte to zero. Occasionally this test is failing, likely because the first byte was already zero. (The test failures are for the cases where failure is expected, `pass=false`)

## Test Plan

Existing test should pass, occasional flakiness should go away.
* Fix method signature parse bug

* Support reference types

* Review dog fixes

* Fix comments
winder and others added 27 commits December 16, 2021 16:19
## Summary

Minor improvements to e2e.sh interactive mode:
* add to -h output
* do not run start stop test in interactive mode
* support fish shell

## Test Plan

Manual testing:
```
~$ ./e2e.sh -i
...
lots of output removed
...
********** READY **********


The test environment is now set. You can now run tests in another terminal.

Configure the environment:

set -g VIRTUAL_ENV "/home/will/go/src/github.com/algorand/go-algorand/tmp/out/e2e/130013-1639576513257/ve"
set -g PATH "$VIRTUAL_ENV/bin:$PATH"

python3 "/home/will/go/src/github.com/algorand/go-algorand/test/scripts"/e2e_client_runner.py  "/home/will/go/src/github.com/algorand/go-algorand/test/scripts"/e2e_subs/SCRIPT_FILE_NAME

Press enter to shut down the test environment...
```
## Summary

New tool: convertAddress
I share this tool with someone every few months, putting it in the repo along with some documentation should make it easier to share and encourage people to share it amongst themselves if it's useful.

Merge `debug` into `tools` to make it easier to organize these miscellaneous tools.
## Summary

Some large teal source files cause the tealdbg/cdt session to choke.  Upping the buffer size to allow for larger source files.

closes #3100 

## Test Plan

Run tealdbg with a large source teal file, ensure the source file makes it to cdt without choking.
Summary
This allows for the deadlock detection threshold to be set by configuration.

Test Plan
Existing tests should pass.
* update abi encoding test random testcase generator, scale down parameters to avoid flaky test

* parameterized test script

* add notes to explain why flaky test is eliminated

* show more information from self-roundtrip testing

* fully utilize require, remove fmt
)

## Summary

This PR moves the catchpoint file writing to be performed outside of the trackers lock. This resolves the issue where a long catchpoint file writing blocks the agreement from validating and propagating votes.

## Test Plan

* [x] Test manually & use existing tests.
* [x] Implement a unit test
* [x] Deploy a local network where the catchpoint writing takes a long time and verify it doesn't get blocked during catchpoint writing.
* Fix method call arg overflow handling

* Only check last log for return value

* Address feedback

* Add comment explaining ABI return prefix
* Support app creation in `goal app method`

* Don't use nonprintable tab character

* Link to specific gist version

* Fix error messages

* Rename `methodCreation` to `methodCreatesApp`
Update license on all source files to 2022.
## Summary

After #2922 there is some leftover unused code for totals calculations. Turned this code into actual asserts.

## Test Plan

This is tests update
## Summary

Followup to #3261 (contained in diff).

Use the new key loading routine from the REST API.

## Test Plan

New unit tests.
## Summary

This PR limits the number of simultaneous REST connections we process to prevent the exhaustion of resources and ultimately a crash.

Two limits are introduced: soft and hard. When the soft limit is exceeded, new connections are returned the 429 Too Many Requests http code. When the hard limit is exceeded, new connections are accepted and immediately closed.

Partially resolves https://github.com/algorand/go-algorand-internal/issues/1814.

## Test Plan

Added unit tests.
## Summary

Replace the standard limit listener with the new rejecting limit listener in `WebsocketNetwork`. This will let the dialing node know that connection is impossible faster.

## Test Plan

Probably not necessary.
## Summary

This PR deletes an unused constant.

## Test Plan

None.
## Summary

This test attempts to cover the case when an accountUpdates.lookupX method can't find the requested address, falls through looking at deltas and the LRU accounts cache, then hits the database — only to discover that the round stored in the database (committed in `accountUpdates.commitRound`) is out of sync with `accountUpdates.cachedDBRound` (updated a little bit later in `accountUpdates.postCommit`).

In this case, the lookup method waits and tries again, iterating the `for { }` it is in. We did not have coverage for this code path before.

## Test Plan

Adds new test.
Adding a test for the fix in #3299

## Test Plan

This is a test
## Summary

This PR deletes unused `AtomicCommitWriteLock()` and simplifies code.

## Test Plan

None.
@jannotti jannotti merged commit 0dd28f2 into feature/contract-to-contract Jan 7, 2022
@jannotti jannotti deleted the feature/c2c-temp branch January 7, 2022 15:49
@@ -565,6 +565,44 @@ func (s base64EncodingSpecMap) getExtraFor(name string) (extra string) {
return
}

// Base64Encoding is an enum for the `base64decode` opcode
type Base64Encoding int
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
Base64Encoding redeclared in this block (typecheck)


const (
// URLEncoding represents the base64url encoding defined in https://www.rfc-editor.org/rfc/rfc4648.html
URLEncoding Base64Encoding = iota
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
URLEncoding redeclared in this block (typecheck)

// URLEncoding represents the base64url encoding defined in https://www.rfc-editor.org/rfc/rfc4648.html
URLEncoding Base64Encoding = iota
// StdEncoding represents the standard encoding of the RFC
StdEncoding
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
StdEncoding redeclared in this block (typecheck)

URLEncoding Base64Encoding = iota
// StdEncoding represents the standard encoding of the RFC
StdEncoding
invalidBase64Alphabet
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
invalidBase64Alphabet redeclared in this block (typecheck)

)

// After running `go generate` these strings will be available:
var base64EncodingNames [2]string = [...]string{URLEncoding.String(), StdEncoding.String()}
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
base64EncodingNames redeclared in this block (typecheck)

version uint64
}

var base64EncodingSpecs = []base64EncodingSpec{
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
base64EncodingSpecs redeclared in this block (typecheck)

{StdEncoding, StackBytes, 6},
}

var base64EncodingSpecByField map[Base64Encoding]base64EncodingSpec
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
base64EncodingSpecByField redeclared in this block (typecheck)

}

var base64EncodingSpecByField map[Base64Encoding]base64EncodingSpec
var base64EncodingSpecByName base64EncodingSpecMap
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
base64EncodingSpecByName redeclared in this block (typecheck)

var base64EncodingSpecByField map[Base64Encoding]base64EncodingSpec
var base64EncodingSpecByName base64EncodingSpecMap

type base64EncodingSpecMap map[string]base64EncodingSpec
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
base64EncodingSpecMap redeclared in this block (typecheck)


type base64EncodingSpecMap map[string]base64EncodingSpec

func (s base64EncodingSpecMap) getExtraFor(name string) (extra string) {
Copy link

Choose a reason for hiding this comment

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

🚫 [Lint Errors] reported by reviewdog 🐶
method getExtraFor already declared for type base64EncodingSpecMap map[string]base64EncodingSpec (typecheck)

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.