Skip to content

Commit

Permalink
Merge pull request #5406 from Algo-devops-service/relbeta3.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
algojohnlee authored May 23, 2023
2 parents 747553d + f256d9d commit 297a4a1
Show file tree
Hide file tree
Showing 358 changed files with 34,018 additions and 9,334 deletions.
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ parameters:
valid_nightly_branch:
type: string
default: /hotfix\/.*/
# The following is intentional - hardcoding a token for public repos
# is recommended here to allow fork access
codecov:
type: string
default: "8b4a1f91-f154-4c26-b84c-c9aaa90159c6"

executors:
amd64_medium:
Expand Down Expand Up @@ -239,6 +244,8 @@ jobs:
executor: << parameters.platform >>_medium
working_directory: << pipeline.parameters.build_dir >>/project
parallelism: 32
environment:
CODECOV_TOKEN: << pipeline.parameters.codecov >>
steps:
- generic_build
- generic_test:
Expand All @@ -254,6 +261,8 @@ jobs:
executor: << parameters.platform >>_large
working_directory: << pipeline.parameters.build_dir >>/project
parallelism: 4
environment:
CODECOV_TOKEN: << pipeline.parameters.codecov >>
steps:
- generic_build
- generic_test:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: "\U0001F41C Bug report"
about: Report a reproducible bug.
title: ''
labels: new-bug
labels: bug
assignees: ''

---
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr-type-category.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
labels: "New Feature, Enhancement, Bug-Fix, Not-Yet-Enabled, Skip-Release-Notes"

- name: "Checking for PR Category in PR title. Should be like '<category>: <pr title>'."
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ ! "${{ github.event.pull_request.title }}" =~ ^.{2,}\:.{2,} ]]; then
if [[ ! "$PR_TITLE" =~ ^.{2,}\:.{2,} ]]; then
echo "## PR Category is missing from PR title. Please add it like '<category>: <pr title>'." >> GITHUB_STEP_SUMMARY
exit 1
fi
1 change: 1 addition & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: reviewdog-golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
go_version_file: go.mod
golangci_lint_version: "v1.47.3"
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
reporter: "github-pr-check"
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ index.html

# test summary
testresults.json

# block generator binary
tools/block-generator/block-generator

# cross repo types tool binary
tools/x-repo-types/x-repo-types
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ linters:
- govet
- ineffassign
- misspell
- nilerr
- nolintlint
- revive
- staticcheck
Expand Down Expand Up @@ -114,6 +115,7 @@ issues:
# - govet
- ineffassign
- misspell
# - nilerr
- nolintlint
# - revive
- staticcheck
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.github/ @algorand/devops
.circleci/ @algorand/devops
74 changes: 39 additions & 35 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,62 @@

If you are interested in contributing to the project, we welcome and thank you. We want to make the best decentralized and effective blockchain platform available and we appreciate your willingness to help us.

The [Algorand GitHub Organization](https://github.com/algorand) has all of our open source projects, and dependencies which we fork and use in those projects. This contribution guide applies to all of these.
The [Algorand GitHub Organization](https://github.com/algorand) has all of our open source projects, and dependencies which we fork and use in those projects. While technical details in this document are specific to `go-algorand`, the general ideas are applicable to all of our projects.

Some of our most active projects include:
* [go-algorand](https://github.com/algorand/go-algorand) - Algorand node software (this repository)
* [go-algorand-sdk](https://github.com/algorand/go-algorand-sdk) - Golang SDK
* [java-algorand-sdk](https://github.com/algorand/java-algorand-sdk) - Java SDK
* [js-algorand-sdk](https://github.com/algorand/js-algorand-sdk) - JavaScript SDK
* [indexer](https://github.com/algorand/indexer) - Blockchain analytics database
* [ledger-app-algorand](https://github.com/algorand/ledger-app-algorand) - Ledger hardware wallet application
* [mule](https://github.com/algorand/mule) - Continuous Integration automation tool
* [py-algorand-sdk](https://github.com/algorand/py-algorand-sdk) - Python SDK
* [sandbox](https://github.com/algorand/sandbox) - Algorand node quickstart tool
## Non-code Contributions

## Filing Issues
While contributions come in many forms, this document is focused on code. For other types of involvement, see the following:
* [Reporting issues and features requests.][go-algorand-issues]
* [Security vulnerability disclosures.][security-disclosure]
* [Documentation improvements.][algorand-docs]

Did you discover a bug? Do you have a feature request? Filing issues is an easy way anyone can contribute and helps us improve Algorand. We use GitHub Issues to track all known bugs and feature requests.
## Contribution Model

Before logging an issue be sure to check current issues, verify that your [node is synced](https://developer.algorand.org/docs/introduction-installing-node#sync-node), check the [Developer Frequently Asked Questions](https://developer.algorand.org/docs/developer-faq) and [GitHub issues][issues_url] to see if your issue is described there.
All changes to `go-algorand` are made through the same process: a pull request targeting the `master` branch. This goes for internal and external contributions. To familiarize yourself with the process we recommend that you review the current open pull requests, and the GitHub documentation for [creating a pull request from a fork][gh-pr-process].

If you’d like to contribute to any of the repositories, please file a [GitHub issue][issues_url] using the issues menu item. Make sure to specify whether you are describing a bug or a new enhancement using the **Bug report** or **Feature request** button.
Note: some of our other projects are using gitflow, for these the process is the same but you will target pull requests against the `develop` branch.

See the GitHub help guide for more information on [filing an issue](https://help.github.com/en/articles/creating-an-issue).
## Communication Channels

## Security / Vulnerabilities
The core development team monitors the Algorand [discord community](https://discord.gg/algorand) and regularly responds to questions and suggestions. For very technical questions and implementation discussions GitHub Issues and Pull Requests are a good way to reach maintainers.

Please refer to our [SECURITY](SECURITY.md) document.
## Pull Requests

If you have any questions, don't hesitate to contact us at [email protected].
All changes are are made via pull requests.

## Contribution Model
Small changes are easier to review and merge than large ones, so the more focused a PR the better. If a feature requires refactoring, the refactoring should be a separate PR. If refactoring uncovers a bug, the fix should be a separate PR. These are not strict rules, but generally speaking, they make things easier to review which speeds up the PR process.

For each of our repositories we use the same model for contributing code. Developers wanting to contribute must create pull requests. This process is described in the GitHub [Creating a pull request from a fork](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork) documentation. Each pull request should be initiated against the `master` branch in the Algorand repository. After a pull request is submitted the core development team will review the submission and communicate with the developer using the comments sections of the PR. After the submission is reviewed and approved, it will be merged into the `master` branch of the source. These changes will be merged to our release branch on the next viable release date. For the SDKs, this may be immediate. Changes to the node software may take more time as we must ensure and verify the security, as well as apply protocol upgrades in an orderly way.
### General Guidelines

Note: some of our projects are using gitflow, for these you will open pull requests against the `develop` branch.
* Have a clear well-formatted description in the pull request. This helps reviewers and later serves as documentation in the release notes.
* Code must adhere to the [Go formatting guidelines](https://golang.org/doc/effective_go.html).
* All tests must be passing.
* New unit and integration tests should be added to ensure correctness and prevent regressions where appropriate.
* Run linting and code formatting tools, see [the README](README.md) for details.
* All CI checks should pass.
* Use draft mode for PRs that are still in progress.

Again, if you have a patch for a critical security vulnerability, please use our [vulnerability disclosure form][vuln_url] instead of creating a PR. We'll follow up with you on distributing the patch before we merge it.
### Peer Review

## Code Guidelines
This is the single most important part of introducing new code to `go-algorand`.

For Go code we use the [Golang guidelines defined here](https://golang.org/doc/effective_go.html).
* Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
* We use **gofmt** and **golangci-lint**. Also make sure to run `make sanity` and `make generate` before opening a pull request.
* Code must be documented adhering to the official Go commentary guidelines.
#### Concept Review

For JavaScript code we use the [MDN formatting rules](https://developer.mozilla.org/en-US/docs/MDN/Contribute/Guidelines/Code_guidelines/JavaScript).
Because code reviews are a considerable time commitment, the first step for peer review is convincing reviewers that it is worth their time. Typically this is done by keeping changes small, writing a thorough description to clearly explain the need for a given improvement, or discussing larger changes ahead of time through one of the communication channels.

For Java code we use [Oracle’s standard formatting rules for Java](https://www.oracle.com/technetwork/java/codeconventions-150003.pdf).
If reviewers are not convinced about the merits of a change, they may reject a PR instead of reviewing it. All rejections should include the rationale for how that decision was reached. It is not uncommon for this to occur. Some users opt to maintain long running forks to add features which are not suitable for the upstream repo at this time.

## Communication Channels
#### Code Review

Reviewers will leave feedback directly on the pull request, typically inline with the code. This is an opportunity to discuss the changes. If a PR is left open with unresolved feedback it may eventually be closed.

The project maintainers are responsible for the code in `go-algorand`, so ultimately whether or not a pull request is merged depends on their involvement.

#### Merge

The core development team monitors the Algorand community forums and regularly responds to questions and suggestions. Issues and Pull Requests are handled on GitHub.
All changes are subject to a minimum of two reviews from subject matter experts prior to merge. Once this approval is reached a small number of committers are responsible for merging the changes. The list of committers is limited for practical and security reasons.

[issues_url]: https://github.com/algorand/go-algorand/issues
[vuln_url]: https://www.algorand.com/resources/blog/security
[bug_bounty_url]: https://bugcrowd.com/algorand
[gh-pr-process]: https://help.github.com/en/articles/creating-a-pull-request-from-a-fork
[go-algorand-issues]: https://github.com/algorand/go-algorand/issues/new/choose
[security-disclosure]: https://github.com/algorand/go-algorand/security/policy
[algorand-docs]: https://github.com/algorand/docs/blob/staging/CONTRIBUTING.md
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ ENV PATH="/node/bin:${PATH}" ALGOD_PORT="8080" KMD_PORT="7833" ALGORAND_DATA="/a
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p "$ALGORAND_DATA" && \
groupadd --system algorand && \
useradd --no-log-init --create-home --system --gid algorand algorand && \
groupadd --gid=999 --system algorand && \
useradd --uid=999 --no-log-init --create-home --system --gid algorand algorand && \
chown -R algorand:algorand /algod

USER algorand

COPY --chown=algorand:algorand --from=builder "/dist/bin/" "/node/bin/"
COPY --chown=algorand:algorand --from=builder "/dist/files/run/" "/node/run/"

Expand Down
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
| rel/stable <br> [![CircleCI](https://circleci.com/gh/algorand/go-algorand/tree/rel%2Fstable.svg?style=svg)](https://circleci.com/gh/algorand/go-algorand/tree/rel%2Fstable) | rel/beta <br> [![CircleCI](https://circleci.com/gh/algorand/go-algorand/tree/rel%2Fbeta.svg?style=svg)](https://circleci.com/gh/algorand/go-algorand/tree/rel%2Fbeta) | rel/nightly <br> [![CircleCI](https://circleci.com/gh/algorand/go-algorand/tree/rel%2Fnightly.svg?style=svg)](https://circleci.com/gh/algorand/go-algorand/tree/rel%2Fnightly) |
| --- | --- | --- |

go-algorand
====================
# go-algorand

Algorand's official implementation in Go.

Algorand is a permissionless, pure proof-of-stake blockchain that delivers
decentralization, scalability, security, and transaction finality.

## Getting Started ##
## Getting Started

Our [developer website][developer site url] has the most up to date information
about using and installing the Algorand platform.

## Building from source ##
## Building from source

Development is done using the [Go Programming Language](https://golang.org/).
The version of go is specified in the project's [go.mod](go.mod) file. This document assumes that you have a functioning
environment setup. If you need assistance setting up an environment please visit
the [official Go documentation website](https://golang.org/doc/).

### Linux / OSX ###
### Linux / OSX

We currently strive to support Debian-based distributions with Ubuntu 18.04
being our official release target.
Expand Down Expand Up @@ -89,17 +89,18 @@ ${GOPATH}/bin/goal node start -d ~/testnet_data
Genesis files for mainnet, testnet, and betanet can be found in
`installer/genesis/`.

## Contributing (Code, Documentation, Bugs, Etc) ##
## Contributing

Please refer to our [CONTRIBUTING](CONTRIBUTING.md) document.


## Project Layout ##
## Project Layout

`go-algorand` is split into various subsystems containing varius packages.

`go-algorand` is split into various subpackages.
### Core

The following packages provide core functionality to the `algod` and `kmd`
daemons, as well as other tools and commands:
Provides core functionality to the `algod` and `kmd` daemons, as well as other tools and commands:

- `crypto` contains the cryptographic constructions we're using for hashing,
signatures, and VRFs. There are also some Algorand-specific details here
Expand Down Expand Up @@ -147,7 +148,9 @@ daemons, as well as other tools and commands:
- `node` integrates the components above and handles initialization and
shutdown. It provides queries into these components.

`daemon` defines the two daemons which provide Algorand clients with services:
### Daemon

Contains the two daemons which provide Algorand clients with services:

- `daemon/algod` holds the `algod` daemon, which implements a participating
node. `algod` allows a node to participate in the agreement protocol,
Expand All @@ -158,7 +161,9 @@ daemons, as well as other tools and commands:
daemon allows a node to sign transactions. Because `kmd` is separate from
`algod`, `kmd` allows a user to sign transactions on an air-gapped computer.

The following packages allow developers to interface with the Algorand system:
### Interfacing

Allows developers to interface with the Algorand system:

- `cmd` holds the primary commands defining entry points into the system.
- `cmd/catchupsrv` ([README](cmd/catchupsrv/README.md)) is a tool to
Expand All @@ -168,8 +173,8 @@ The following packages allow developers to interface with the Algorand system:
- `tools/debug` holds secondary commands which assist developers during debugging.
- `tools/misc` ([README](tools/misc/README.md)) small tools that are sometimes handy in a pinch.

The following packages contain tools to help Algorand developers deploy networks
of their own:
### Deployment
Help Algorand developers deploy networks of their own:

- `nodecontrol`
- `docker`
Expand All @@ -178,12 +183,14 @@ of their own:
- `components`
- `netdeploy`

A number of packages provide utilities for the various components:
### Utilities
Provides utilities for the various components:

- `logging` is a wrapper around `logrus`.
- `util` contains a variety of utilities, including a codec, a SQLite wrapper,
a goroutine pool, a timer interface, node metrics, and more.

### Test
`test` ([README](test/README.md)) contains end-to-end tests and utilities for the above components.


Expand Down
14 changes: 7 additions & 7 deletions agreement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ parameters:
If `Ledger` and `db.Accessor` provide crash-safe storage, `agreement`
will also recover safely after crashes.

# Specification
## Specification

The specification for the protocol implemented by this package is
located [here](https://github.com/algorandfoundation/specs).

Optimizations from and other deviations from the spec will be noted
throughout this file.

## Terminology
### Terminology

Certain terms in this implementation are used as shorthands for
specific concepts:
Expand All @@ -68,7 +68,7 @@ specific concepts:
a quorum of soft votes (i.e., sigma(S, r, p)).
- Additional terminology is described in the [agreement service doc](../docs/agreement_service.md).

# Design
## Design

At the top level, an `agreement.Service` encapsulates the parameters
and the goroutines which execute the protocol.
Expand Down Expand Up @@ -97,7 +97,7 @@ data structures, such as `vote`, `bundle`, and `proposal`. These data
types have distinct unauthenticated versions, which allows routines to
specify that they accept untrusted input.

# Concurrent Component
## Concurrent Component

The `demux` object demultiplexes over a variety of channels which all
represent inputs to the system. Inputs include:
Expand All @@ -121,7 +121,7 @@ machine validates these messages in the same way it validates real
network messages and relays them back into the network as
appropriate.

## Spec Notes: Additional Events
### Spec Notes: Additional Events

Because signature verification is expected to be a computational
bottleneck in the agreement code, it executes concurrently with
Expand Down Expand Up @@ -154,7 +154,7 @@ verification concurrently. Moreover, the implementation abstracts
over multiple keys by generating synthetic network events from the
`pseudonode`.

# Serialized State Machine
## Serialized State Machine

The logic of the agreement protocol is implemented as a state machine.
This state machine is composed of many smaller state machines, which
Expand Down Expand Up @@ -356,5 +356,5 @@ a given period.
The staging slot for a given period is important because its state is
the precursor to cert and next votes. Once both a soft threshold for a
value and the `Block` corresponding to this value has been observed by
the node, a `proposalCommittableEvent` is emitted, which indicates
the node, a proposal `committableEvent` is emitted, which indicates
that the node may cert or next-vote for the proposal.
6 changes: 3 additions & 3 deletions agreement/abstractions.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ type LedgerReader interface {
// protocol may lose liveness.
LookupAgreement(basics.Round, basics.Address) (basics.OnlineAccountData, error)

// Circulation returns the total amount of money in circulation at the
// conclusion of a given round.
// Circulation returns the total amount of online money in circulation at the
// conclusion of a given round rnd that is eligible for voting at voteRnd.
//
// This method returns an error if the given Round has not yet been
// confirmed. It may also return an error if the given Round is
// unavailable by the storage device. In that case, the agreement
// protocol may lose liveness.
Circulation(basics.Round) (basics.MicroAlgos, error)
Circulation(rnd basics.Round, voteRnd basics.Round) (basics.MicroAlgos, error)

// LookupDigest returns the Digest of the entry that was agreed on in a
// given round.
Expand Down
Loading

0 comments on commit 297a4a1

Please sign in to comment.