Skip to content

Commit

Permalink
Some general linting (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnomalRoil committed Mar 7, 2022
1 parent d795c5d commit d7dbb14
Show file tree
Hide file tree
Showing 44 changed files with 89 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
deploy
test-integration-notls
test-integration-tls
test-integration-tls
14 changes: 7 additions & 7 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
description: "Suggests that having worked on the specific component affected by this issue is important"
- name: dif/expert
color: 2f365f
description: "Requires extensive knowledge of the history, implications, ramifications of the issue"
description: "Requires extensive knowledge of the history, implications, ramifications of the issue"

###
### Efforts
Expand All @@ -104,7 +104,7 @@
description: "Effort: One Week"
- name: effort/weeks
color: 20504f
description: "Effort: Multiple Weeks"
description: "Effort: Multiple Weeks"

###
### Impacts
Expand All @@ -123,7 +123,7 @@
description: "Impact: Developer Experience"
- name: impact/test-flakiness
color: DDE1E4
description: "Impact: Test Flakiness"
description: "Impact: Test Flakiness"

###
### Topics
Expand All @@ -139,7 +139,7 @@
description: "Topic: Documentation"
- name: topic/architecture
color: E53599
description: "Topic: Architecture"
description: "Topic: Architecture"

###
### Priorities
Expand All @@ -165,7 +165,7 @@
description: "Hint: Good First Issue"
- name: hint/help-wanted
color: 008672
description: "Hint: Help Wanted"
description: "Hint: Help Wanted"
- name: hint/needs-participation
color: 0D937F
description: "Hint: Needs Participation"
Expand All @@ -192,7 +192,7 @@
description: "Hint: Needs Review"
- name: hint/desc-outdated
color: 73F9E5
description: "Hint: Description Outdated"
description: "Hint: Description Outdated"

###
### Statuses
Expand All @@ -217,7 +217,7 @@
description: "Status: Waiting"
- name: status/rotten
color: 7A4033
description: "Status: Rotten"
description: "Status: Rotten"
- name: status/discarded
color: 6D3326
description: "Status: Discarded / Won't fix"
2 changes: 1 addition & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
version: '3.17.x'
- name: Install Protoc-gen-go
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0
- name: Generate
run: go generate ./...&& go mod tidy
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: ${{ steps.report.outputs.result }}

2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- run: make coverage
- run: bash <(curl -s https://codecov.io/bash)
- run: bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ drand-relay-http
drand-relay-s3
test/docker/tmp
test/docker/data*
**/nohup.out
**/nohup.out
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,3 @@ linters-settings:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped

2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,3 @@ ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]

# Defaults for drand go here
CMD ["start", "--tls-disable", "--control 8888", "--private-listen 0.0.0.0:4444"]


2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ install_deps_darwin:
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-osx-x86_64.zip
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
rm -f $PROTOC_ZIP
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
Drand (pronounced "dee-rand") is a distributed randomness beacon daemon
Drand (pronounced "dee-rand") is a distributed randomness beacon daemon
written in <a href="https://golang.org/">Golang</a>.
</p>

Expand Down Expand Up @@ -68,17 +68,17 @@ source of randomness which is:

* Decentralized: drand is a software ran by a diverse set of reputable entities
on the Internet and a threshold of them is needed to generate randomness,
there is no central point of failure.
there is no central point of failure.
* Publicly verifiable & unbiased: drand periodically delivers publicly
verifiable and unbiased randomness. Any third party can fetch and verify the
authenticity of the randomness and by that making sure it hasn't been
tampered with.
* And "private" as well: drand nodes can also deliver encrypted randomness
* And "private" as well: drand nodes can also deliver encrypted randomness
to be used in a local applications, for example to seed the OS's PRNG.

A drand network is operated by a group of organizations around the world that
includes Cloudflare, EPFL, Kudelski Security, Protocol Labs, Celo, UCL, and
UIUC. You can learn more by visiting the
A drand network is operated by a group of organizations around the world that
includes Cloudflare, EPFL, Kudelski Security, Protocol Labs, Celo, UCL, and
UIUC. You can learn more by visiting the
[League of Entropy website](https://leagueofentropy.com), where you can also
see the random values being generated by the network in real time.

Expand Down Expand Up @@ -261,16 +261,16 @@ refer to the

## Documentation

Here is a list of all documentation related to drand:
Here is a list of all documentation related to drand:

- To learn more about the protocol, the motivation and its backgronund
- For a high level presentation of motivations and background, here are some public
[slides](https://docs.google.com/presentation/d/1t2ysit78w0lsySwVbQOyWcSDnYxdOBPzY7K2P9UE1Ac/edit?usp=sharing)
about drand or online [video](https://www.youtube.com/watch?v=ydwW2HFFxNI&list=PLhuBigpl7lqu6xWpiXtbEzJQtlMH1tqoG&index=3).
- [A basic explainer of the cryptography behind drand](https://hackmd.io/@nikkolasg/HyUAgm234),
- [A basic explainer of the cryptography behind drand](https://hackmd.io/@nikkolasg/HyUAgm234),
- [Protocol Specification](https://drand.love/docs/specification/)
- API documentation
- [The client-side API documentation of drand](https://hackmd.io/@nikkolasg/HJ9lg5ZTE)
- [The client-side API documentation of drand](https://hackmd.io/@nikkolasg/HJ9lg5ZTE)
- DevOps/Deployment documentation
- [Deployment instructions](https://drand.love/operator/deploy/)
- [Security Model](https://drand.love/docs/security-model/)
Expand Down Expand Up @@ -315,7 +315,7 @@ following:
+ Add a systemd unit file
+ Support multiple drand instances within one node

Feel free to submit feature requests or, even better, pull requests ;)
Feel free to submit feature requests or, even better, pull requests ;)

## Acknowledgments

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Upcoming major or minor releases will go through a release-candidate cycle befor

## Reporting a Vulnerability

If you believe to have found a security issue that can cause biasability, denial of service, or compromise of the active network, please send us a private email to security@drand.love. Please DO NOT file a public issue. We'll make sure to get back to you ASAP, work towards verifying the issue, mitigating it and providing an update for our users.
If you believe to have found a security issue that can cause biasability, denial of service, or compromise of the active network, please send us a private email to security@drand.love. Please DO NOT file a public issue. We'll make sure to get back to you ASAP, work towards verifying the issue, mitigating it and providing an update for our users.

To help us serving the drand ecosystem, we appreciate that your reports are as precise as possible, ideally containing a way to reproduce the vulnerability.

If the issue is a protocol weakness that cannot be immediately exploited or something not yet deployed, feel welcome to discuss it openly in a [Github issue](https://github.com/drand/drand/issues/new).

For all other kinds of bugs, please [file an issue in this repo](https://github.com/drand/drand/issues/new).
For all other kinds of bugs, please [file an issue in this repo](https://github.com/drand/drand/issues/new).
2 changes: 1 addition & 1 deletion demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
data/group.toml
data/*.public
data/*.public
8 changes: 4 additions & 4 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Local demo of drand
# Local demo of drand

This folder contains code that spins up drand nodes in the same way as in a real
world deployment. It uses real processes as drand instances and uses the CLI
commands.
commands.

## What the demo is doing

Expand All @@ -15,10 +15,10 @@ the steps the demo is performing:
* Doing a resharing to an extended group
* Checking the new network produces valid random beacons

## Run the demo
## Run the demo

```
go build && ./demo -build
go build && ./demo -build
```

You can stop the demo by CTRL-C when ever you want.
Expand Down
4 changes: 2 additions & 2 deletions demo/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Prerequisites:

Run the demo: `./run.sh`

This commands builds the docker images, and starts the containers:
This commands builds the docker images, and starts the containers:

![Setup](https://user-images.githubusercontent.com/5019664/73373513-06e0cc00-42b9-11ea-9a87-3acf16a20b29.png)

Expand All @@ -27,4 +27,4 @@ However, on MacOS X, `curl` cannot contact internal containers (see the [issue](

`docker exec drand1 call_api`

which simply calls `curl` from inside `drand1`.
which simply calls `curl` from inside `drand1`.
2 changes: 1 addition & 1 deletion demo/docker/data/client-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ fi
# Let the deamon alive for long enough
sleep 9999

echo "Done"
echo "Done"
1 change: 0 additions & 1 deletion demo/docker/data/group.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ TLS = false
Address = "172.16.238.6:8084"
Key = "af9e658b200dd3aa2bbd8619968a71f7a667a51484ac8ba1beb38e0c53b2e3c527d96c82cbe12c879ba103f1ff9a5602"
TLS = false

15 changes: 5 additions & 10 deletions demo/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,54 @@ services:
drand-client-1:
container_name: drand1
image: drand-it
container_name: drand1
build:
context: ..
dockerfile: Dockerfile
entrypoint: /data/client-script.sh
volumes:
- ./data:/data:z
networks:
networks:
- drandnetwork
environment:
PORT: 8080
LEADER: 1
drand-client-2:
container_name: drand2
image: drand-it
container_name: drand2
entrypoint: /data/client-script.sh
volumes:
- ./data:/data:z
networks:
networks:
- drandnetwork
environment:
PORT: 8081
drand-client-3:
container_name: drand3
image: drand-it
container_name: drand3
entrypoint: /data/client-script.sh
volumes:
- ./data:/data:z
networks:
networks:
- drandnetwork
environment:
PORT: 8082
drand-client-4:
container_name: drand4
image: drand-it
container_name: drand4
entrypoint: /data/client-script.sh
volumes:
- ./data:/data:z
networks:
networks:
- drandnetwork
environment:
PORT: 8083
drand-client-5:
container_name: drand5
image: drand-it
container_name: drand5
entrypoint: /data/client-script.sh
volumes:
- ./data:/data:z
networks:
networks:
- drandnetwork
environment:
PORT: 8084
Expand Down
6 changes: 3 additions & 3 deletions demo/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ trap 'cleanup ; printf "Tests have been killed via signal.\n"' HUP INT QUIT PIPE
GROUP_FILE="./data/group.toml"

# threshold: 3 nodes out of 5, period for randomness: 10 seconds
echo -en "Threshold = 3\nPeriod = \"10s\"\n\n" > "${GROUP_FILE}"
chmod ugo+rwx "${GROUP_FILE}"
echo -en "Threshold = 3\nPeriod = \"10s\"\n\n" > "${GROUP_FILE}"
chmod ugo+rwx "${GROUP_FILE}"
rm -f data/*.public

# build and run 5 docker images (what each container does is in data/client-script.sh)
Expand All @@ -28,4 +28,4 @@ echo " alternative: docker exec drand1 call_api "
echo ""

docker-compose logs -f
cleanup
cleanup
2 changes: 1 addition & 1 deletion docker/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
data/*.pem
data/*.pem
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
---
1) Build the image from docker image with `docker build --build-arg version='git describe --tags' --build-arg gitCommit='git rev-parse HEAD' -t drandorg/go-drand:latest .` on the project root folder
2) Run `docker-compose -f "docker-compose.yml" up`
3) Execute the script called `startBeacon.sh` in order to run the setup phase. After that, the nodes will start to generate randomness
3) Execute the script called `startBeacon.sh` in order to run the setup phase. After that, the nodes will start to generate randomness
2 changes: 1 addition & 1 deletion protobuf/common/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ message Metadata {
NodeVersion node_version = 1;
string beaconID = 2;
bytes chain_hash = 3;
}
}
8 changes: 4 additions & 4 deletions protobuf/crypto/dkg/dkg.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This protobuf file contains the definitions of all the calls and messages
* used by drand nodes themselves to create the distributed randomness beacon.
*/
*/
syntax = "proto3";

package dkg;
Expand All @@ -27,7 +27,7 @@ message Packet {
message DealBundle {
// Index of the dealer that issues these deals
uint32 dealer_index = 1;
// Coefficients of the public polynomial that is created from the
// Coefficients of the public polynomial that is created from the
// private polynomial from which the shares are derived.
repeated bytes commits = 2;
// list of deals for each individual share holders.
Expand All @@ -45,7 +45,7 @@ message Deal {
bytes encrypted_share = 2;
}

// ResponseBundle is a packet issued by a share holder that contains all the
// ResponseBundle is a packet issued by a share holder that contains all the
// responses (complaint and/or success) to broadcast.
message ResponseBundle {
uint32 share_index = 1;
Expand All @@ -61,7 +61,7 @@ message ResponseBundle {
message Response {
// index of the dealer for which this response is for
uint32 dealer_index = 1;
// Status represents a complaint if set to false, a success if set to
// Status represents a complaint if set to false, a success if set to
// true.
bool status = 2;
}
Expand Down
2 changes: 0 additions & 2 deletions protobuf/drand/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,3 @@ message HomeResponse {
string status = 1;
common.Metadata metadata = 2;
}


Loading

0 comments on commit d7dbb14

Please sign in to comment.