Skip to content

Commit

Permalink
Merge branch 'develop' into TT-974-chainlink-evm-workflow-call
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon authored Mar 7, 2024
2 parents 4d3a962 + 5dc76ac commit b4baaa8
Show file tree
Hide file tree
Showing 114 changed files with 484 additions and 1,925 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ on:

jobs:
golangci:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' }}
# We don't directly merge dependabot PRs, so let's not waste the resources
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' && github.actor != 'dependabot[bot]'}}
name: lint
runs-on: ubuntu20.04-8cores-32GB
steps:
Expand All @@ -44,6 +45,8 @@ jobs:
matrix:
cmd: ["go_core_tests", "go_core_race_tests", "go_core_fuzz"]
name: Core Tests (${{ matrix.cmd }})
# We don't directly merge dependabot PRs, so let's not waste the resources
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu20.04-64cores-256GB
env:
CL_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
enforce-ctf-version:
name: Enforce CTF Version
runs-on: ubuntu-latest
# We don't directly merge dependabot PRs, so let's not waste the resources
if: github.actor != 'dependabot[bot]'
steps:
- run: echo "${{github.event_name}}"
- name: Checkout the repo
Expand Down Expand Up @@ -93,6 +95,8 @@ jobs:
environment: integration
name: Check Paths That Require Tests To Run
runs-on: ubuntu-latest
# We don't directly merge dependabot PRs, so let's not waste the resources
if: github.actor != 'dependabot[bot]'
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -127,6 +131,8 @@ jobs:
build-lint-integration-tests:
name: Build and Lint integration-tests
runs-on: ubuntu20.04-16cores-64GB
# We don't directly merge dependabot PRs, so let's not waste the resources
if: github.actor != 'dependabot[bot]'
strategy:
matrix:
project:
Expand Down Expand Up @@ -853,6 +859,8 @@ jobs:
name: Get Solana Sha From Go Mod
environment: Integration
runs-on: ubuntu-latest
# We don't directly merge dependabot PRs, so let's not waste the resources
if: github.actor != 'dependabot[bot]'
outputs:
sha: ${{ steps.getsha.outputs.sha }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ tools/flakeytests/coverage.txt
**/testdata/fuzz/*

# Runtime test configuration that might contain secrets
overrides.toml
override*.toml

# Pythin venv
.venv/
8 changes: 4 additions & 4 deletions common/fee/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"github.com/shopspring/decimal"
)

func ApplyMultiplier(feeLimit uint32, multiplier float32) (uint32, error) {
result := decimal.NewFromBigInt(big.NewInt(0).SetUint64(uint64(feeLimit)), 0).Mul(decimal.NewFromFloat32(multiplier)).IntPart()
func ApplyMultiplier(feeLimit uint64, multiplier float32) (uint64, error) {
result := decimal.NewFromBigInt(big.NewInt(0).SetUint64(feeLimit), 0).Mul(decimal.NewFromFloat32(multiplier))

if result > math.MaxUint32 {
if result.GreaterThan(decimal.NewFromBigInt(big.NewInt(0).SetUint64(math.MaxUint64), 0)) {
return 0, fmt.Errorf("integer overflow when applying multiplier of %f to fee limit of %d", multiplier, feeLimit)
}
return uint32(result), nil
return result.BigInt().Uint64(), nil
}

// Returns the input value increased by the given percentage.
Expand Down
2 changes: 1 addition & 1 deletion common/txmgr/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) tryA
return eb.saveTryAgainAttempt(ctx, lgr, etx, attempt, replacementAttempt, initialBroadcastAt, fee, feeLimit)
}

func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) saveTryAgainAttempt(ctx context.Context, lgr logger.Logger, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time, newFee FEE, newFeeLimit uint32) (err error, retyrable bool) {
func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) saveTryAgainAttempt(ctx context.Context, lgr logger.Logger, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], replacementAttempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time, newFee FEE, newFeeLimit uint64) (err error, retyrable bool) {
if err = eb.txStore.SaveReplacementInProgressAttempt(ctx, attempt, &replacementAttempt); err != nil {
return fmt.Errorf("tryAgainWithNewFee failed: %w", err), true
}
Expand Down
6 changes: 3 additions & 3 deletions common/txmgr/confirmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) bum
logFields := ec.logFieldsPreviousAttempt(previousAttempt)

var bumpedFee FEE
var bumpedFeeLimit uint32
var bumpedFeeLimit uint64
bumpedAttempt, bumpedFee, bumpedFeeLimit, _, err = ec.NewBumpTxAttempt(ctx, etx, previousAttempt, previousAttempts, ec.lggr)

// if no error, return attempt
Expand Down Expand Up @@ -1039,7 +1039,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) mar
// This operates completely orthogonal to the normal Confirmer and can result in untracked attempts!
// Only for emergency usage.
// This is in case of some unforeseen scenario where the node is refusing to release the lock. KISS.
func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ForceRebroadcast(ctx context.Context, seqs []SEQ, fee FEE, address ADDR, overrideGasLimit uint32) error {
func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) ForceRebroadcast(ctx context.Context, seqs []SEQ, fee FEE, address ADDR, overrideGasLimit uint64) error {
if len(seqs) == 0 {
ec.lggr.Infof("ForceRebroadcast: No sequences provided. Skipping")
return nil
Expand Down Expand Up @@ -1082,7 +1082,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) For
return nil
}

func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) sendEmptyTransaction(ctx context.Context, fromAddress ADDR, seq SEQ, overrideGasLimit uint32, fee FEE) (string, error) {
func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) sendEmptyTransaction(ctx context.Context, fromAddress ADDR, seq SEQ, overrideGasLimit uint64, fee FEE) (string, error) {
gasLimit := overrideGasLimit
if gasLimit == 0 {
gasLimit = ec.feeConfig.LimitDefault()
Expand Down
2 changes: 1 addition & 1 deletion common/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SendNative
ToAddress: to,
EncodedPayload: []byte{},
Value: value,
FeeLimit: gasLimit,
FeeLimit: uint64(gasLimit),
Strategy: NewSendEveryStrategy(),
}
etx, err = b.pruneQueueAndCreateTxn(ctx, txRequest, chainID)
Expand Down
4 changes: 2 additions & 2 deletions common/txmgr/types/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ type TransactionClient[
) (client.SendTxReturnCode, error)
SendEmptyTransaction(
ctx context.Context,
newTxAttempt func(ctx context.Context, seq SEQ, feeLimit uint32, fee FEE, fromAddress ADDR) (attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error),
newTxAttempt func(ctx context.Context, seq SEQ, feeLimit uint64, fee FEE, fromAddress ADDR) (attempt TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error),
seq SEQ,
gasLimit uint32,
gasLimit uint64,
fee FEE,
fromAddress ADDR,
) (txhash string, err error)
Expand Down
2 changes: 1 addition & 1 deletion common/txmgr/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type BroadcasterListenerConfig interface {

type ConfirmerFeeConfig interface {
BumpTxDepth() uint32
LimitDefault() uint32
LimitDefault() uint64

// from gas.Config
BumpThreshold() uint64
Expand Down
Loading

0 comments on commit b4baaa8

Please sign in to comment.