Skip to content

Commit

Permalink
merge feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarak Ben Youssef committed Feb 17, 2023
2 parents e64cc36 + 9429bde commit 7593960
Show file tree
Hide file tree
Showing 680 changed files with 32,749 additions and 17,673 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Use benchstat for comparison
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install golang.org/x/perf/cmd/benchstat@latest
go install golang.org/x/perf/cmd/benchstat@91a04616dc65ba76dbe9e5cf746b923b1402d303
echo "BENCHSTAT<<EOF" >> $GITHUB_ENV
echo "$(benchstat -html -sort delta old.txt new.txt | sed '/<title/,/<\/style>/d' | sed 's/<!doctype html>//g')" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
cache: true
- name: Run tests (${{ matrix.targets.name }})
if: github.actor != 'bors[bot]'
uses: nick-invision/retry@v2
uses: nick-fields/retry@v2
with:
timeout_minutes: 25
max_attempts: 3
Expand All @@ -128,7 +128,7 @@ jobs:
# RACE_DETECTOR: 1
- name: Run tests (Bors)
if: github.actor == 'bors[bot]'
uses: nick-invision/retry@v2
uses: nick-fields/retry@v2
with:
timeout_minutes: 25
max_attempts: 3
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
VERBOSE=1 make -C ${{ matrix.name }} ${{ matrix.make2 }}
- name: Run tests (Bors)
if: github.actor == 'bors[bot]'
uses: nick-invision/retry@v2
uses: nick-fields/retry@v2
with:
timeout_minutes: 25
max_attempts: ${{ matrix.retries }}
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
# RACE_DETECTOR: 1
- name: Run tests (Bors)
if: github.actor == 'bors[bot]'
uses: nick-invision/retry@v2
uses: nick-fields/retry@v2
with:
timeout_minutes: 15
max_attempts: 2
Expand Down
31 changes: 31 additions & 0 deletions LicensingApproach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Flow's Approach to Licensing

The founding team for Flow suggests that all open-source software built on or for Flow should adhere to the "[Coherent Open Source Licensing](https://licenseuse.org)" philosophy.
To that end, we encourage the use of one of the following three licenses, as applicable by the use case (order from most permissive, to most restrictive):

- Apache 2.0
- LGPL 3
- Affero GPL 3

These licenses are all approved by both the Free Software Foundation and the Open Source Initiative and contain clauses regarding software patenting to avoid hidden patent concerns. Additionally, they are all compatible with each other meaning there is no conflict using them together in any project (provided the project as a whole meets the requirements of the most restrictive of the licenses included).


### Apache 2.0

Apache 2.0 is the most permissive, and allows reuse - with customization - in proprietary software. We recommend that this should be the default for any code that has significant potential use for off-chain tools and/or applications. In particular, all sample code (including smart contracts), SDKs, utility libraries and tools should default to Apache 2.0.


### LGPL 3

LGPL 3 allows use in proprietary software, provided that any customizations to the licensed code are shared. We considered LGPL for Cadence to avoid a proprietary fork of the language, but decided to use the more permissive Apache 2.0 license to emphasize that we hope Cadence can be adopted outside of Flow. LGPL can be used for other parts of Flow where necessary (e.g. if the component is itself a modification of other LGPL-licensed code).


### Affero GPL 3

Affero GPL 3 (AGPL) should be used for all code that exists primarily to power node software. In particular, the core consensus and computation layers should be provided via AGPL where possible. We chose this license because we interpret the clauses in the AGPL regarding "public use [...] on a publicly accessible server" as covering the operation of a node in the public Flow network. By requiring all modifications to the core node software to be made publicly available, we increase the security of the network (allowing any custom modifications to undergo public scrutiny), while also ensuring that improvements to the core infrastructure benefit all participants in the network.


### Using the Unlicense

For small snippets of sample code, we can provide access via the Unlicense.
Broadly speaking, Apache 2.0 gives essentially the same rights to the receiver of the code as Unlicense, except that Apache protects the author(s) a bit more robustly, and protects the receiver against patent lawsuits. But, some people aren't aware of this, and using the "Unlicense" makes it very clear to anyone that the original authors aren't claiming ownership of derivative works. For any "complex" code that we want to be free, we should use Apache. For simple code snippets and examples, the Unlicense will probably make casual/inexperienced developers feel more comfortable.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ cmd/collection/collection:
cmd/util/util:
go build -o cmd/util/util --tags relic cmd/util/main.go

.PHONY: update-core-contracts-version
update-core-contracts-version:
./scripts/update-core-contracts.sh $(CC_VERSION)

############################################################################################
# CAUTION: DO NOT MODIFY THESE TARGETS! DOING SO WILL BREAK THE FLAKY TEST MONITOR

Expand Down Expand Up @@ -151,6 +155,7 @@ generate-mocks: install-mock-generators
mockery --name '.*' --dir="state/protocol/events" --case=underscore --output="./state/protocol/events/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/execution/computation/computer --case=underscore --output="./engine/execution/computation/computer/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/execution/state --case=underscore --output="./engine/execution/state/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/collection --case=underscore --output="./engine/collection/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/consensus --case=underscore --output="./engine/consensus/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/consensus/approvals --case=underscore --output="./engine/consensus/approvals/mock" --outpkg="mock"
rm -rf ./fvm/environment/mock
Expand Down
4 changes: 2 additions & 2 deletions access/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (h *Handler) GetExecutionResultForBlockID(ctx context.Context, req *access.
func (h *Handler) blockResponse(block *flow.Block, fullResponse bool, status flow.BlockStatus) (*access.BlockResponse, error) {
signerIDs, err := h.signerIndicesDecoder.DecodeSignerIDs(block.Header)
if err != nil {
return nil, err
return nil, err // the block was retrieved from local storage - so no errors are expected
}

var msg *entities.Block
Expand All @@ -513,7 +513,7 @@ func (h *Handler) blockResponse(block *flow.Block, fullResponse bool, status flo
func (h *Handler) blockHeaderResponse(header *flow.Header, status flow.BlockStatus) (*access.BlockHeaderResponse, error) {
signerIDs, err := h.signerIndicesDecoder.DecodeSignerIDs(header)
if err != nil {
return nil, err
return nil, err // the block was retrieved from local storage - so no errors are expected
}

msg, err := convert.BlockHeaderToMessage(header, signerIDs)
Expand Down
4 changes: 4 additions & 0 deletions admin/command_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,7 @@ func (r *CommandRunner) runCommand(ctx context.Context, command string, data int

return handleResult, nil
}

func (r *CommandRunner) GrpcAddress() string {
return r.grpcAddress
}
Loading

0 comments on commit 7593960

Please sign in to comment.