Skip to content

Commit

Permalink
Merge branch 'develop' into BCF-2964-validate-p2p-for-OCR
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny authored Feb 16, 2024
2 parents 57e8043 + 4c4ac47 commit 27e5ba6
Show file tree
Hide file tree
Showing 93 changed files with 1,605 additions and 530 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-sign-publish-chainlink/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ runs:

- name: Generate docker metadata for root image
id: meta-root
uses: docker/metadata-action@2c0bd771b40637d97bf205cbccdd294a32112176 # v4.5.0
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c # v5.5.0
env:
DOCKER_METADATA_PR_HEAD_SHA: "true"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/delete-deployments/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inputs:
runs:
using: composite
steps:
- uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ^8.0.0

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-nodejs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Setup pnpm for contracts
runs:
using: composite
steps:
- uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: ^7.0.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bash-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: bash-scripts
with:
filters: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ jobs:
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds)
go install ./cmd/chainlink-feeds
popd
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-data-streams)
go install ./mercury/cmd/chainlink-mercury
popd
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana)
go install ./pkg/solana/cmd/chainlink-solana
popd
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer)
go install ./pkg/chainlink/cmd/chainlink-starknet
popd
make install-mercury-loop
- name: Increase Race Timeout
if: github.event.schedule != ''
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
with:
filters: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
with:
filters: |
Expand All @@ -68,6 +68,7 @@ jobs:
- '.github/workflows/integration-tests.yml'
- '**/*Dockerfile'
- 'core/**/config/**/*.toml'
- 'integration-tests/**/*.toml'
- name: Collect Metrics
if: always()
id: collect-gha-metrics
Expand Down Expand Up @@ -122,9 +123,9 @@ jobs:
- name: ""
dockerfile: core/chainlink.Dockerfile
tag-suffix: ""
# - name: (plugins)
# dockerfile: plugins/chainlink.Dockerfile
# tag-suffix: -plugins
- name: (plugins)
dockerfile: plugins/chainlink.Dockerfile
tag-suffix: -plugins
name: Build Chainlink Image ${{ matrix.image.name }}
runs-on: ubuntu20.04-16cores-64GB
needs: [changes, enforce-ctf-version]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
with:
# Foundry is only used for Solidity v0.8 contracts, therefore we can ignore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solidity-hardhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
with:
filters: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
id: changes
with:
list-files: "csv"
Expand Down
5 changes: 0 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ chainlink-local-start:
install-medianpoc: ## Build & install the chainlink-medianpoc binary.
go install $(GOFLAGS) ./plugins/cmd/chainlink-medianpoc

.PHONY: install-mercury-loop
install-mercury-loop: ## Build & install the chainlink-medianpoc binary.
go install $(GOFLAGS) ./plugins/cmd/chainlink-mercury


.PHONY: docker ## Build the chainlink docker image
docker:
docker buildx build \
Expand Down
2 changes: 1 addition & 1 deletion charts/chainlink-cluster/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ replace (
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

// until merged upstream: https://github.com/hashicorp/go-plugin/pull/257
github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306
github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16

// until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69
github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f
Expand Down
30 changes: 30 additions & 0 deletions common/client/mock_rpc_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions common/client/multi_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,17 @@ func (c *multiNode[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OP
return n.RPC().CallContract(ctx, attempt, blockNumber)
}

func (c *multiNode[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, RPC_CLIENT]) PendingCallContract(
ctx context.Context,
attempt interface{},
) (rpcErr []byte, extractErr error) {
n, err := c.selectNode()
if err != nil {
return rpcErr, err
}
return n.RPC().PendingCallContract(ctx, attempt)
}

// ChainID makes a direct RPC call. In most cases it should be better to use the configured chain id instead by
// calling ConfiguredChainID.
func (c *multiNode[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OPS, TX_RECEIPT, FEE, HEAD, RPC_CLIENT]) ChainID(ctx context.Context) (id CHAIN_ID, err error) {
Expand Down
4 changes: 4 additions & 0 deletions common/client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ type clientAPI[
msg interface{},
blockNumber *big.Int,
) (rpcErr []byte, extractErr error)
PendingCallContract(
ctx context.Context,
msg interface{},
) (rpcErr []byte, extractErr error)
CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
CodeAt(ctx context.Context, account ADDR, blockNumber *big.Int) ([]byte, error)
}
Expand Down
29 changes: 24 additions & 5 deletions contracts/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,10 @@ Here are some examples of what this should look like:

```solidity
contract AccessControlledFoo is Foo {
// solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables
string public constant override typeAndVersion = "AccessControlledFoo 1.0.0";
}
contract OffchainAggregator is ITypeAndVersion {
// solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables
string public constant override typeAndVersion = "OffchainAggregator 1.0.0";
function getData() public returns(uint256) {
Expand All @@ -256,8 +254,6 @@ contract OffchainAggregator is ITypeAndVersion {
contract SuperDuperAggregator is ITypeAndVersion {
/// This is a new contract that has not been released yet, so we
/// add a `-dev` suffix to the typeAndVersion.
// solhint-disable-next-line chainlink-solidity/all-caps-constant-storage-variables
string public constant override typeAndVersion = "SuperDuperAggregator 1.1.0-dev";
function getData() public returns(uint256) {
Expand Down Expand Up @@ -388,4 +384,27 @@ rule: `custom-errors`

Interfaces should be named `IFoo` instead of `FooInterface`. This follows the patterns of popular [libraries like OpenZeppelin’s](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol#L9).

rule: `tbd`
rule: `tbd`

## Structs

Structs should be constructed with named arguments. This prevents accidental assignment to the wrong field and makes the code more readable.

```solidity
// Good
function setConfig(uint64 _foo, uint64 _bar, uint64 _baz) external {
config = Config({
foo: _foo,
bar: _bar,
baz: _baz
});
}
// Bad
function setConfig(uint64 _foo, uint64 _bar, uint64 _baz) external {
config = Config(_foo, _bar, _baz);
}
```

rule: `tbd`

Loading

0 comments on commit 27e5ba6

Please sign in to comment.