Skip to content

Commit

Permalink
Merge branch 'develop' into re-2428/add-cicd-changeset
Browse files Browse the repository at this point in the history
* develop:
  [KS-136] Write target fixes (#12743)
  chore/release 2.10.0 to develop (#12740)
  [KS-136] Disallow non-trigger steps with no dependent ref (#12742)
  [KS-136] Correctly handle numbers in YAML by converting them to floats or ints (#12739)
  New log buffer (#12357)
  [KS-101] Add OCR3 capability contract wrapper (#12404)
  core/services/relay/evm: switch RequestRound DB & Tracker to use sqlutil.DataSource (#12706)
  Unregister filters for old coordinator contracts contract addresses from Functions LogPollerWrapper (#12696)
  • Loading branch information
momentmaker committed Apr 8, 2024
2 parents d6f8a63 + 0148439 commit c0b7932
Show file tree
Hide file tree
Showing 48 changed files with 3,178 additions and 752 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-poets-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Remove LogPoller filters for outdated Functions coordinator contracts
5 changes: 5 additions & 0 deletions .changeset/pink-ducks-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Add OCR3 capability contract wrapper
7 changes: 7 additions & 0 deletions .changeset/pretty-experts-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"chainlink": patch
---

Added log buffer v1 with improved performance, stability and control over scaling parameters.

Added a feature flag for using log buffer v1.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
- HeadTracker now respects the `FinalityTagEnabled` config option. If the flag is enabled, HeadTracker backfills blocks up to the latest finalized block provided by the corresponding RPC call. To address potential misconfigurations, `HistoryDepth` is now calculated from the latest finalized block instead of the head. NOTE: Consumers (e.g. TXM and LogPoller) do not fully utilize Finality Tag yet.

...
<!-- unreleasedstop -->

## 2.10.0 - UNRELEASED
## 2.10.0 - 2024-04-05

### Added

Expand All @@ -20,6 +21,7 @@
- Add preliminary support for "llo" job type (Data Streams V1)
- Add `LogPrunePageSize` parameter to the EVM configuration. This parameter controls the number of logs removed during prune phase in LogPoller. Default value is 0, which deletes all logs at once - exactly how it used to work, so it doesn't require any changes on the product's side.
- Add Juels Fee Per Coin data source caching for OCR2 Feeds. Cache is time based and is turned on by default with default cache refresh of 5 minutes. Cache can be configured through pluginconfig using "juelsPerFeeCoinCacheDuration" and "juelsPerFeeCoinCacheDisabled" tags. Duration tag accepts values between "30s" and "20m" with default of "0s" that is overridden on cache startup to 5 minutes.
- Add rebalancer support for feeds manager ocr2 plugins.

### Fixed

Expand All @@ -31,8 +33,6 @@
- Minimum required version of Postgres is now >= 12. Postgres 11 was EOL'd in November 2023. Added a new version check that will prevent Chainlink from running on EOL'd Postgres. If you are running Postgres <= 11 you should upgrade to the latest version. The check can be forcibly overridden by setting SKIP_PG_VERSION_CHECK=true.
- Updated the `LimitDefault` and `LimitMax` configs types to `uint64`

<!-- unreleasedstop -->

## 2.9.1 - 2024-03-07

### Changed
Expand Down
1 change: 1 addition & 0 deletions contracts/scripts/native_solc_compile_all_keystone
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ compileContract () {
}

compileContract keystone/KeystoneForwarder.sol
compileContract keystone/OCR3Capability.sol
20 changes: 19 additions & 1 deletion core/capabilities/targets/write_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,24 @@ func (cap *EvmWrite) Execute(ctx context.Context, callback chan<- capabilities.C
return err
}
inputs := inputsAny.(map[string]any)
rep, ok := inputs["report"]
if !ok {
return errors.New("malformed data: inputs doesn't contain a report key")
}

if rep == nil {
// We received any empty report -- this means we should skip transmission.
cap.lggr.Debugw("Skipping empty report", "request", request)
go func() {
// TODO: cast tx.Error to Err (or Value to Value?)
callback <- capabilities.CapabilityResponse{
Value: nil,
Err: nil,
}
close(callback)
}()
return nil
}

// evaluate any variables in reqConfig.Params
args, err := evaluateParams(reqConfig.Params, inputs)
Expand Down Expand Up @@ -222,7 +240,7 @@ func (cap *EvmWrite) Execute(ctx context.Context, callback chan<- capabilities.C
if err != nil {
return err
}
fmt.Printf("Transaction submitted %v", tx.ID)
cap.lggr.Debugw("Transaction submitted", "request", request, "transaction", tx)
go func() {
// TODO: cast tx.Error to Err (or Value to Value?)
callback <- capabilities.CapabilityResponse{
Expand Down
52 changes: 52 additions & 0 deletions core/capabilities/targets/write_target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,55 @@ func TestEvmWrite(t *testing.T) {
response := <-ch
require.Nil(t, response.Err)
}

func TestEvmWrite_EmptyReport(t *testing.T) {
chain := evmmocks.NewChain(t)

txManager := txmmocks.NewMockEvmTxManager(t)
chain.On("ID").Return(big.NewInt(11155111))
chain.On("TxManager").Return(txManager)

cfg := configtest.NewGeneralConfig(t, func(c *chainlink.Config, s *chainlink.Secrets) {
a := testutils.NewAddress()
addr, err := types.NewEIP55Address(a.Hex())
require.NoError(t, err)
c.EVM[0].ChainWriter.FromAddress = &addr

forwarderA := testutils.NewAddress()
forwarderAddr, err := types.NewEIP55Address(forwarderA.Hex())
require.NoError(t, err)
c.EVM[0].ChainWriter.ForwarderAddress = &forwarderAddr
})
evmcfg := evmtest.NewChainScopedConfig(t, cfg)
chain.On("Config").Return(evmcfg)

capability := targets.NewEvmWrite(chain, logger.TestLogger(t))
ctx := testutils.Context(t)

config, err := values.NewMap(map[string]any{
"abi": "receive(report bytes)",
"params": []any{"$(report)"},
})
require.NoError(t, err)

inputs, err := values.NewMap(map[string]any{
"report": nil,
})
require.NoError(t, err)

req := capabilities.CapabilityRequest{
Metadata: capabilities.RequestMetadata{
WorkflowID: "hello",
},
Config: config,
Inputs: inputs,
}

ch := make(chan capabilities.CapabilityResponse)

err = capability.Execute(ctx, ch, req)
require.NoError(t, err)

response := <-ch
require.Nil(t, response.Err)
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
GETH_VERSION: 1.13.8
forwarder: ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin 4886b538e1fdc8aaf860901de36269e0c35acfd3e6eb190654d693ff9dbd4b6d
ocr3_capability: ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.bin 9dcbdf55bd5729ba266148da3f17733eb592c871c2108ccca546618628fd9ad2
1 change: 1 addition & 0 deletions core/gethwrappers/keystone/go_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ package gethwrappers
// Keystone

//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.abi ../../../contracts/solc/v0.8.19/KeystoneForwarder/KeystoneForwarder.bin KeystoneForwarder forwarder
//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.abi ../../../contracts/solc/v0.8.19/OCR3Capability/OCR3Capability.bin OCR3Capability ocr3_capability
1 change: 1 addition & 0 deletions core/services/chainlink/relayer_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (r *RelayerFactory) NewEVM(ctx context.Context, config EVMFactoryConfig) (m

relayerOpts := evmrelay.RelayerOpts{
DB: ccOpts.SqlxDB,
DS: ccOpts.DB,
QConfig: ccOpts.AppConfig.Database(),
CSAETHKeystore: config.CSAETHKeystore,
MercuryPool: r.MercuryPool,
Expand Down
1 change: 1 addition & 0 deletions core/services/job/spawner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ func TestSpawner_CreateJobDeleteJob(t *testing.T) {

evmRelayer, err := evmrelayer.NewRelayer(lggr, chain, evmrelayer.RelayerOpts{
DB: db,
DS: db,
QConfig: testopts.GeneralConfig.Database(),
CSAETHKeystore: keyStore,
})
Expand Down
9 changes: 9 additions & 0 deletions core/services/ocr2/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/autotelemetry21"
ocr2keeper21core "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/core"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider"
ocr2vrfconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2vrf/config"
ocr2coordinator "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2vrf/coordinator"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2vrf/juelsfeecoin"
Expand Down Expand Up @@ -1313,6 +1314,14 @@ func (d *Delegate) newServicesOCR2Keepers21(
return nil, errors.New("could not coerce PluginProvider to AutomationProvider")
}

// TODO: (AUTO-9355) remove once we remove v0
if useBufferV1 := cfg.UseBufferV1 != nil && *cfg.UseBufferV1; useBufferV1 {
logProviderFeatures, ok := keeperProvider.LogEventProvider().(logprovider.LogEventProviderFeatures)
if ok {
logProviderFeatures.WithBufferVersion("v1")
}
}

services, err := ocr2keeper.EVMDependencies21(kb)
if err != nil {
return nil, errors.Wrap(err, "could not build dependencies for ocr2 keepers")
Expand Down
3 changes: 3 additions & 0 deletions core/services/ocr2/plugins/ocr2keeper/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ type PluginConfig struct {
ContractVersion string `json:"contractVersion"`
// CaptureAutomationCustomTelemetry is a bool flag to toggle Custom Telemetry Service
CaptureAutomationCustomTelemetry *bool `json:"captureAutomationCustomTelemetry,omitempty"`
// UseBufferV1 is a bool flag to toggle the new log buffer implementation
// TODO: (AUTO-9355) remove once we have a single version
UseBufferV1 *bool `json:"useBufferV1,omitempty"`
}

func ValidatePluginConfig(cfg PluginConfig) error {
Expand Down
Loading

0 comments on commit c0b7932

Please sign in to comment.