Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Nov 23, 2023
1 parent 801507a commit 302244d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion common/txmgr/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) tryA
func (eb *Broadcaster[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) tryAgainWithNewEstimation(ctx context.Context, lgr logger.Logger, txError error, etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], attempt txmgrtypes.TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], initialBroadcastAt time.Time) (err error, retryable bool) {
if attempt.TxType == 0x2 {
err = errors.Errorf("re-estimation is not supported for EIP-1559 transactions. Node returned error: %v. This is a bug", txError.Error())
logger.Sugared(eb.lggr).AssumptionViolationf(err.Error())
logger.Sugared(eb.lggr).AssumptionViolation(err.Error())
return err, false
}

Expand Down
3 changes: 1 addition & 2 deletions common/txmgr/confirmer.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,7 @@ func (ec *Confirmer[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) bat
receipt := txReceipts[i]
err := txErrs[i]

lggr = attempt.Tx.GetLogger(lggr)
l := logger.Sugared(logger.With(lggr, "txHash", attempt.Hash.String(), "txAttemptID", attempt.ID,
l := logger.Sugared(logger.With(attempt.Tx.GetLogger(lggr), "txHash", attempt.Hash.String(), "txAttemptID", attempt.ID,
"txID", attempt.TxID, "err", err, "sequence", attempt.Tx.Sequence,
))

Expand Down
3 changes: 1 addition & 2 deletions core/chains/evm/client/send_only_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ type sendOnlyNode struct {
func NewSendOnlyNode(lggr logger.Logger, httpuri url.URL, name string, chainID *big.Int) SendOnlyNode {
s := new(sendOnlyNode)
s.name = name
s.log = logger.Named(lggr, "SendOnlyNode")
s.log = logger.Named(s.log, name)
s.log = logger.Named(logger.Named(lggr, "SendOnlyNode"), name)
s.log = logger.With(s.log,
"nodeTier", "sendonly",
)
Expand Down
12 changes: 6 additions & 6 deletions core/chains/evm/log/registrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (r *handler) addSubscriber(sub *subscriber, handlersWithGreaterConfs []*han

for topic, topicValueFilters := range sub.opts.LogsWithTopics {
if _, exists := r.lookupSubs[addr][topic]; !exists {
logger.Tracew(r.logger, "No existing sub for addr %s and topic %s at this MinIncomingConfirmations of %v", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)
logger.Tracef(r.logger, "No existing sub for addr %s and topic %s at this MinIncomingConfirmations of %v", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)
r.lookupSubs[addr][topic] = make(subscribers)

func() {
Expand All @@ -295,11 +295,11 @@ func (r *handler) addSubscriber(sub *subscriber, handlersWithGreaterConfs []*han
// again since even the worst case lookback is already covered
for _, existingHandler := range handlersWithGreaterConfs {
if _, exists := existingHandler.lookupSubs[addr][topic]; exists {
logger.Tracew(r.logger, "Sub already exists for addr %s and topic %s at greater than this MinIncomingConfirmations of %v. Resubscribe is not required", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)
logger.Tracef(r.logger, "Sub already exists for addr %s and topic %s at greater than this MinIncomingConfirmations of %v. Resubscribe is not required", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)
return
}
}
logger.Tracew(r.logger, "No sub exists for addr %s and topic %s at this or greater MinIncomingConfirmations of %v. Resubscribe is required", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)
logger.Tracef(r.logger, "No sub exists for addr %s and topic %s at this or greater MinIncomingConfirmations of %v. Resubscribe is required", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)
needsResubscribe = true
}
}()
Expand Down Expand Up @@ -332,7 +332,7 @@ func (r *handler) removeSubscriber(sub *subscriber, allHandlers map[uint32]*hand

// cleanup and resubscribe if necessary
if len(topicMap) == 0 {
logger.Tracew(r.logger, "No subs left for addr %s and topic %s at this MinIncomingConfirmations of %v", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)
logger.Tracef(r.logger, "No subs left for addr %s and topic %s at this MinIncomingConfirmations of %v", addr.Hex(), topic.Hex(), sub.opts.MinIncomingConfirmations)

func() {
if !needsResubscribe {
Expand All @@ -344,12 +344,12 @@ func (r *handler) removeSubscriber(sub *subscriber, allHandlers map[uint32]*hand
continue
}
if _, exists := otherHandler.lookupSubs[addr][topic]; exists {
logger.Tracew(r.logger, "Sub still exists for addr %s and topic %s. Resubscribe will not be performed", addr.Hex(), topic.Hex())
logger.Tracef(r.logger, "Sub still exists for addr %s and topic %s. Resubscribe will not be performed", addr.Hex(), topic.Hex())
return
}
}

logger.Tracew(r.logger, "No sub exists for addr %s and topic %s. Resubscribe will be performed", addr.Hex(), topic.Hex())
logger.Tracef(r.logger, "No sub exists for addr %s and topic %s. Resubscribe will be performed", addr.Hex(), topic.Hex())
needsResubscribe = true
}
}()
Expand Down
4 changes: 2 additions & 2 deletions core/services/vrf/v2/integration_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ func TestRequestCost(t *testing.T) {
"requestRandomness", vrfkey.PublicKey.MustHash(), subId.Uint64(), uint16(2), uint32(10000), uint32(1))
tt.Log("gas estimate of proxied requestRandomness:", estimate)
// There is some gas overhead of the delegatecall that is made by the proxy
// to the logic contract. See https://www.legacyevm.codes/#f4?fork=grayGlacier for a detailed
// to the logic contract. See https://www.evm.codes/#f4?fork=grayGlacier for a detailed
// breakdown of the gas costs of a delegatecall.
assert.Less(tt, estimate, uint64(96_000),
"proxied testRequestRandomness tx gas cost more than expected")
Expand Down Expand Up @@ -2161,7 +2161,7 @@ func TestStartingCountsV1(t *testing.T) {
require.NoError(t, err)
}

// add legacyevm.receipts
// add evm.receipts
receipts := []evmtypes.Receipt{}
for i := 0; i < 4; i++ {
receipts = append(receipts, evmtypes.Receipt{
Expand Down

0 comments on commit 302244d

Please sign in to comment.