Skip to content

Commit

Permalink
Merge branch 'more-lp-comments' of github.com:smartcontractkit/chainl…
Browse files Browse the repository at this point in the history
…ink into more-lp-comments
  • Loading branch information
connorwstein committed Aug 29, 2022
2 parents f179e56 + 1b6cae6 commit f2dfc63
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 41 deletions.
6 changes: 3 additions & 3 deletions contracts/src/v0.8/dev/KeeperRegistryBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ abstract contract KeeperRegistryBase is ConfirmedOwner, ExecutionPrevention, Ree
uint32 internal constant UINT32_MAX = type(uint32).max;
uint96 internal constant LINK_TOTAL_SUPPLY = 1e27;
UpkeepFormat internal constant UPKEEP_TRANSCODER_VERSION_BASE = UpkeepFormat.V2;

// L1_FEE_DATA_PADDING includes 35 bytes for L1 data padding for Optimism
bytes public L1_FEE_DATA_PADDING = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
bytes internal constant L1_FEE_DATA_PADDING =
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
// MAX_INPUT_DATA represents the estimated max size of the sum of L1 data padding and msg.data in performUpkeep
// function, which includes 4 bytes for function selector, 32 bytes for upkeep id, 35 bytes for data padding, and
// 64 bytes for estimated perform data
bytes public MAX_INPUT_DATA =
bytes internal constant MAX_INPUT_DATA =
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";

address[] internal s_keeperList;
Expand Down
2 changes: 1 addition & 1 deletion core/logger/critical.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package logger

import "go.uber.org/zap/zapcore"

// encodeLevel is a zapcore.EncodeLevel that encodes crit in place of dpanic for our custom Critical* level.
// encodeLevel is a zapcore.EncodeLevel that encodes 'crit' in place of dpanic for our custom Critical* level.
func encodeLevel(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder) {
if l == zapcore.DPanicLevel {
enc.AppendString("crit")
Expand Down
3 changes: 2 additions & 1 deletion core/logger/fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package logger_test
import (
"testing"

"github.com/smartcontractkit/chainlink/core/logger"
"github.com/stretchr/testify/assert"

"github.com/smartcontractkit/chainlink/core/logger"
)

func TestFields_Merge(t *testing.T) {
Expand Down
5 changes: 0 additions & 5 deletions core/logger/helpers_test.go

This file was deleted.

20 changes: 10 additions & 10 deletions core/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ func init() {
// Loggers should be injected (and usually Named as well): e.g. lggr.Named("<service name>")
//
// Tests
// - Tests should use a TestLogger, with NewLogger being reserved for actual
// runtime and limited direct testing.
// - Tests should use a TestLogger, with NewLogger being reserved for actual
// runtime and limited direct testing.
//
// Levels
// - Fatal: Logs and then calls os.Exit(1). Be careful about using this since it does NOT unwind the stack and may exit uncleanly.
// - Panic: Unrecoverable error. Example: invariant violation, programmer error
// - Critical: Requires quick action from the node op, obviously these should happen extremely rarely. Example: failed to listen on TCP port
// - Error: Something bad happened, and it was clearly on the node op side. No need for immediate action though. Example: database write timed out
// - Warn: Something bad happened, not clear who/what is at fault. Node ops should have a rough look at these once in a while to see whether anything stands out. Example: connection to peer was closed unexpectedly. observation timed out.
// - Info: High level information. First level we’d expect node ops to look at. Example: entered new epoch with leader, made an observation with value, etc.
// - Debug: Useful for forensic debugging, but we don't expect nops to look at this. Example: Got a message, dropped a message, ...
// - Trace: Only included if compiled with the trace tag. For example: go test -tags trace ...
// - Fatal: Logs and then calls os.Exit(1). Be careful about using this since it does NOT unwind the stack and may exit uncleanly.
// - Panic: Unrecoverable error. Example: invariant violation, programmer error
// - Critical: Requires quick action from the node op, obviously these should happen extremely rarely. Example: failed to listen on TCP port
// - Error: Something bad happened, and it was clearly on the node op side. No need for immediate action though. Example: database write timed out
// - Warn: Something bad happened, not clear who/what is at fault. Node ops should have a rough look at these once in a while to see whether anything stands out. Example: connection to peer was closed unexpectedly. observation timed out.
// - Info: High level information. First level we’d expect node ops to look at. Example: entered new epoch with leader, made an observation with value, etc.
// - Debug: Useful for forensic debugging, but we don't expect nops to look at this. Example: Got a message, dropped a message, ...
// - Trace: Only included if compiled with the trace tag. For example: go test -tags trace ...
//
// Node Operator Docs: https://docs.chain.link/docs/configuration-variables/#log_level
type Logger interface {
Expand Down
7 changes: 3 additions & 4 deletions core/logger/sentry_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package logger_test
package logger

import (
"testing"

"github.com/smartcontractkit/chainlink/core/logger"
"github.com/stretchr/testify/assert"
)

Expand All @@ -13,7 +12,7 @@ func Test_toMap(t *testing.T) {
"foo", 1, "bar", 42.43, "boggly", "str",
}

m := logger.ToMap(keysAndValues)
m := toMap(keysAndValues)

assert.Equal(t, map[string]interface{}{"bar": 42.43, "boggly": "str", "foo": 1}, m)
})
Expand All @@ -23,7 +22,7 @@ func Test_toMap(t *testing.T) {
"foo", 1, "bar", 42.43, "boggly", "str", "odd",
}

m := logger.ToMap(keysAndValues)
m := toMap(keysAndValues)

assert.Equal(t, map[string]interface{}{"bar": 42.43, "boggly": "str", "foo": 1}, m)
})
Expand Down
2 changes: 1 addition & 1 deletion core/logger/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (l *zapLogger) Helper(skip int) Logger {
}

func (l *zapLogger) sugaredHelper(skip int) *zap.SugaredLogger {
return l.SugaredLogger.Desugar().WithOptions(zap.AddCallerSkip(skip)).Sugar()
return l.SugaredLogger.WithOptions(zap.AddCallerSkip(skip))
}

func (l *zapLogger) ErrorIf(err error, msg string) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ require (
go.dedis.ch/kyber/v3 v3.0.13
go.uber.org/atomic v1.9.0
go.uber.org/multierr v1.8.0
go.uber.org/zap v1.21.0
go.uber.org/zap v1.23.0
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
golang.org/x/exp v0.0.0-20220608143224-64259d1afd70
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,8 @@ go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI=
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY=
go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/contracts/contract_deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,14 @@ func (e *EthereumContractDeployer) DeployMockETHLINKFeed(answer *big.Int) (MockE
auth *bind.TransactOpts,
backend bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return ethereum.DeployMockV3AggregatorContract(auth, backend, 18, answer)
return ethereum.DeployMockETHLINKAggregator(auth, backend, answer)
})
if err != nil {
return nil, err
}
return &EthereumMockETHLINKFeed{
client: e.client,
feed: instance.(*ethereum.MockV3AggregatorContract),
feed: instance.(*ethereum.MockETHLINKAggregator),
address: address,
}, err
}
Expand Down Expand Up @@ -481,7 +481,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry(
auth *bind.TransactOpts,
backend bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return ethereum.DeployKeeperRegistry(
return ethereum.DeployKeeperRegistry12(
auth,
backend,
common.HexToAddress(opts.LinkAddr),
Expand Down Expand Up @@ -510,7 +510,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry(
client: e.client,
version: ethereum.RegistryVersion_1_2,
registry1_1: nil,
registry1_2: instance.(*ethereum.KeeperRegistry),
registry1_2: instance.(*ethereum.KeeperRegistry12),
address: address,
}, err

Expand Down
5 changes: 3 additions & 2 deletions integration-tests/contracts/ethereum_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
"github.com/smartcontractkit/chainlink-testing-framework/contracts/ethereum"

"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/testreporters"
)
Expand Down Expand Up @@ -989,7 +990,7 @@ func (v *EthereumVRF) ProofLength(ctxt context.Context) (*big.Int, error) {
// EthereumMockETHLINKFeed represents mocked ETH/LINK feed contract
type EthereumMockETHLINKFeed struct {
client blockchain.EVMClient
feed *ethereum.MockV3AggregatorContract
feed *ethereum.MockETHLINKAggregator
address *common.Address
}

Expand All @@ -1005,7 +1006,7 @@ func (v *EthereumMockETHLINKFeed) LatestRoundData() (*big.Int, error) {
if err != nil {
return nil, err
}
return data.Answer, nil
return data.Ans, nil
}

// EthereumMockGASFeed represents mocked Gas feed contract
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/contracts/ethereum_keeper_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"fmt"
"math/big"
"strconv"
"time"

"strings"
"time"

"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
Expand All @@ -18,6 +17,7 @@ import (

"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
"github.com/smartcontractkit/chainlink-testing-framework/contracts/ethereum"

"github.com/smartcontractkit/chainlink/integration-tests/testreporters"
)

Expand Down Expand Up @@ -149,7 +149,7 @@ type EthereumKeeperRegistry struct {
client blockchain.EVMClient
version ethereum.KeeperRegistryVersion
registry1_1 *ethereum.KeeperRegistry11
registry1_2 *ethereum.KeeperRegistry
registry1_2 *ethereum.KeeperRegistry12
address *common.Address
}

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ require (
github.com/rs/zerolog v1.27.0
github.com/satori/go.uuid v1.2.0
github.com/slack-go/slack v0.11.2
github.com/smartcontractkit/chainlink-env v0.2.35
github.com/smartcontractkit/chainlink-testing-framework v1.5.8
github.com/smartcontractkit/chainlink-env v0.2.36
github.com/smartcontractkit/chainlink-testing-framework v1.5.10
github.com/smartcontractkit/libocr v0.0.0-20220701150323-d815c8d0eab8
github.com/stretchr/testify v1.8.0
go.uber.org/atomic v1.9.0
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/slack-go/slack v0.11.2 h1:IWl90Rk+jqPEVyiBytH27CSN/TFAg2vuDDfoPRog/nc=
github.com/slack-go/slack v0.11.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/smartcontractkit/chainlink-env v0.2.35 h1:xveefHkVsyavsEQAI7pO9uCAfoED7izhqnme1lGeFI4=
github.com/smartcontractkit/chainlink-env v0.2.35/go.mod h1:pPMIcVvyS9owsJ2e1zqFsfaDjeoUlpsWtV+Ndm3/JN8=
github.com/smartcontractkit/chainlink-testing-framework v1.5.8 h1:bAOP5KcHXwbcysScCXq4Ovgufs4HyDxWkUkyVhGhcfY=
github.com/smartcontractkit/chainlink-testing-framework v1.5.8/go.mod h1:xv840sOjnMYkR+YUYta/sVr0HF1Tb52vUJ777yYEaXc=
github.com/smartcontractkit/chainlink-env v0.2.36 h1:FzYcjQ/siMOvJxUC7G2+SLquEvx4/uPYjx2xVprfjdE=
github.com/smartcontractkit/chainlink-env v0.2.36/go.mod h1:pPMIcVvyS9owsJ2e1zqFsfaDjeoUlpsWtV+Ndm3/JN8=
github.com/smartcontractkit/chainlink-testing-framework v1.5.10 h1:ZoA0xVweFs0k1AfU2J1brqomQFLfUrYJKzs3Pk7G6AU=
github.com/smartcontractkit/chainlink-testing-framework v1.5.10/go.mod h1:+rKGnT70sk5LXzvLZ0+Wjn3kMycYIJhf0lb9OFYyBgA=
github.com/smartcontractkit/libocr v0.0.0-20220701150323-d815c8d0eab8 h1:raZou4k7yhqym37dqOV5xGV730G/xvBK0gDHjWHuTJw=
github.com/smartcontractkit/libocr v0.0.0-20220701150323-d815c8d0eab8/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
Expand Down

0 comments on commit f2dfc63

Please sign in to comment.