Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pkg): add ticker package #2617

Merged
merged 6 commits into from
Aug 6, 2024
Merged

feat(pkg): add ticker package #2617

merged 6 commits into from
Aug 6, 2024

Conversation

swift1337
Copy link
Contributor

@swift1337 swift1337 commented Aug 1, 2024

We have a lot of repetitive code chunks where we have the following logic:

  • Invoke foobar() (first invokation)
  • Setup a ticker that invokes foobar() every interval
  • Optionally update ticker's interval
  • Do this indefinitely or unless some external signal is received

This PR implements exactly this logic with small and simple API in a declarative way.

Package ticker also handles context cancellation and panic recovery 😎

Relates to #1611

before

func (ob *Observer) WatchInbound(ctx context.Context) error {
	app, err := zctx.FromContext(ctx)
	if err != nil {
		return err
	}

	ticker, err := clienttypes.NewDynamicTicker(
		fmt.Sprintf("EVM_WatchInbound_%d", ob.Chain().ChainId),
		ob.GetChainParams().InboundTicker,
	)
	if err != nil {
		ob.Logger().Inbound.Error().Err(err).Msg("error creating ticker")
		return err
	}
	defer ticker.Stop()

	ob.Logger().Inbound.Info().Msgf("WatchInbound started for chain %d", ob.Chain().ChainId)
	sampledLogger := ob.Logger().Inbound.Sample(&zerolog.BasicSampler{N: 10})

	for {
		select {
		case <-ticker.C():
			if !app.IsInboundObservationEnabled(ob.GetChainParams()) {
				sampledLogger.Info().
					Msgf("WatchInbound: inbound observation is disabled for chain %d", ob.Chain().ChainId)
				continue
			}
			err := ob.ObserveInbound(ctx, sampledLogger)
			if err != nil {
				ob.Logger().Inbound.Err(err).Msg("WatchInbound: observeInbound error")
			}
			ticker.UpdateInterval(ob.GetChainParams().InboundTicker, ob.Logger().Inbound)
		case <-ob.StopChannel():
			ob.Logger().Inbound.Info().Msgf("WatchInbound stopped for chain %d", ob.Chain().ChainId)
			return nil
		}
	}
}

after

func (ob *Observer) WatchInbound(ctx context.Context) error {
	app, err := zctx.FromContext(ctx)
	if err != nil {
		return err
	}

	ob.Logger().Inbound.Info().Msgf("WatchInbound started for chain %d", ob.Chain().ChainId)

	var (
		logger   = ob.Logger().Inbound.Sample(&zerolog.BasicSampler{N: 10})
		interval = ticker.SecondsFromUint64(ob.GetChainParams().InboundTicker)
	)

	t := ticker.New(interval, func(ctx context.Context, t *ticker.Ticker) error {
		// noop
		if !app.IsInboundObservationEnabled(ob.GetChainParams()) {
			logger.Info().Msg("WatchInbound: inbound observation is disabled")
			return nil
		}

		if err := ob.ObserveInbound(ctx, logger); err != nil {
			ob.Logger().Inbound.Err(err).Msg("WatchInbound: observeInbound error")
		}

		newInterval := ticker.SecondsFromUint64(ob.GetChainParams().InboundTicker)
		t.SetInterval(newInterval)

		return nil
	})

	bg.Work(ctx, func(_ context.Context) error {
		<-ob.StopChannel()
		t.Stop()
		ob.Logger().Inbound.Info().Msg("WatchInbound stopped")
		return nil
	})

	return t.Run(ctx)
}

Summary by CodeRabbit

  • New Features

    • Introduced a dynamic ticker functionality allowing for periodic execution of tasks with adjustable intervals.
    • Enhanced inbound observation process with improved tick management using the new ticker package.
  • Bug Fixes

    • Improved error handling and graceful termination for the ticker, addressing potential issues in previous implementations.
  • Tests

    • Added a comprehensive suite of unit tests to validate the new ticker's functionality and ensure robust context management and error handling.
  • Refactor

    • Refactored the WatchInbound method to utilize the new ticker package, improving code readability and maintainability.

@swift1337 swift1337 added no-changelog Skip changelog CI check code-quality Code quality improvement labels Aug 1, 2024
@swift1337 swift1337 self-assigned this Aug 1, 2024
Copy link
Contributor

coderabbitai bot commented Aug 1, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Walkthrough

The changes implemented across the codebase introduce a new ticker package that facilitates dynamic, periodic execution of functions with runtime interval adjustments. This enhances the management of time-based tasks, ensuring safe concurrent usage, graceful termination, and improved error handling. Additionally, modifications to the WatchInbound method in the Observer struct streamline the control flow and improve readability by leveraging the new ticker functionality.

Changes

Files Change Summary
pkg/ticker/ticker.go Introduced a new ticker package with a Ticker type, Runner function type, and methods for dynamic execution and interval management.
pkg/ticker/ticker_test.go Added comprehensive unit tests for the ticker, validating functionalities like basic operation, error handling, dynamic interval adjustment, and graceful stopping.
zetaclient/chains/evm/observer/inbound.go Refactored WatchInbound method to utilize the new ticker package for improved structure, readability, and error handling, with enhanced stopping logic.

Sequence Diagram(s)

sequenceDiagram
    participant Observer
    participant Ticker
    participant Runner

    Observer->>Ticker: New(interval, runner)
    Ticker->>Runner: Execute immediately
    loop Every interval
        Ticker->>Runner: Execute
        alt Error handling
            Runner->>Ticker: Return error
            Ticker->>Observer: Stop execution
        end
        alt Interval adjustment
            Ticker->>Ticker: SetInterval(newInterval)
        end
    end
    Ticker->>Observer: Stop signal received
    Ticker->>Ticker: Cleanup
Loading

This diagram illustrates the interactions between the Observer, Ticker, and Runner during the lifecycle of a periodic task execution, highlighting error handling and interval adjustments.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 54.68750% with 29 lines in your changes missing coverage. Please review.

Project coverage is 70.59%. Comparing base (eb61f2d) to head (ccbef87).
Report is 1 commits behind head on develop.

Files Patch % Lines
zetaclient/chains/evm/observer/inbound.go 0.00% 23 Missing ⚠️
pkg/ticker/ticker.go 85.36% 4 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2617      +/-   ##
===========================================
+ Coverage    70.55%   70.59%   +0.04%     
===========================================
  Files          335      336       +1     
  Lines        18345    18384      +39     
===========================================
+ Hits         12943    12978      +35     
- Misses        4821     4823       +2     
- Partials       581      583       +2     
Files Coverage Δ
pkg/ticker/ticker.go 85.36% <85.36%> (ø)
zetaclient/chains/evm/observer/inbound.go 38.57% <0.00%> (+0.16%) ⬆️

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

Outside diff range, codebase verification and nitpick comments (7)
pkg/ticker/ticker.go (6)

1-11: Improve package documentation.

The package documentation is clear but can be enhanced by including information about thread safety and usage scenarios.

// Package ticker provides a dynamic ticker that can change its interval at runtime.
// The ticker can be stopped gracefully and handles context-based termination.
//
// This package is useful for scenarios where periodic execution of a function is needed
// and the interval might need to change dynamically based on runtime conditions.
//
// It also invokes a first tick immediately after the ticker starts. It's safe to use it concurrently.
//
// It also terminates gracefully when the context is done (return ctx.Err()) or when the stop signal is received.
//
// Example usage:
//
//	ticker := New(time.Second, func(ctx context.Context, t *Ticker) error {
//	    resp, err := client.GetPrice(ctx)
//	    if err != nil {
//	        logger.Err(err).Error().Msg("failed to get price")
//	        return nil
//	    }
//
//	    observer.SetPrice(resp.GasPrice)
//	    t.SetInterval(resp.GasPriceInterval)
//
//	    return nil
//	})
//
//	err := ticker.Run(ctx)

38-39: Clarify the Ticker struct documentation.

The comment mentions that the ticker invokes "BEFORE" it starts, which is unclear. It should specify that the ticker invokes the runner function immediately upon starting.

// Ticker represents a ticker that will run a function periodically.
// It also invokes the runner function immediately after the ticker starts.

46-47: Clarify the purpose of runnerMu.

The comment should clarify that runnerMu prevents concurrent runs of the Run method.

// runnerMu is a mutex to prevent concurrent runs of the Run method

49-50: Clarify the purpose of stateMu.

The comment should clarify that stateMu prevents concurrent calls to SetInterval and Stop.

// stateMu is a mutex to prevent concurrent calls to SetInterval and Stop

55-56: Clarify the Runner type documentation.

The comment should specify that the Runner function is called periodically by the Ticker.

// Runner is a function that will be called periodically by the Ticker

68-71: Improve utility function name.

The function name SecondsFromUint64 can be more descriptive. Consider renaming it to DurationFromSeconds.

-// SecondsFromUint64 converts uint64 to time.Duration in seconds.
-func SecondsFromUint64(d uint64) time.Duration {
+// DurationFromSeconds converts uint64 to time.Duration in seconds.
+func DurationFromSeconds(d uint64) time.Duration {
Tools
GitHub Check: codecov/patch

[warning] 69-70: pkg/ticker/ticker.go#L69-L70
Added lines #L69 - L70 were not covered by tests

pkg/ticker/ticker_test.go (1)

1-10: Add missing imports.

The test file is missing imports for require from testify package, which is useful for making assertions.

import (
	"context"
	"fmt"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between aed7caa and 198c12d.

Files selected for processing (3)
  • pkg/ticker/ticker.go (1 hunks)
  • pkg/ticker/ticker_test.go (1 hunks)
  • zetaclient/chains/evm/observer/inbound.go (2 hunks)
Additional context used
Path-based instructions (3)
pkg/ticker/ticker.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

pkg/ticker/ticker_test.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

zetaclient/chains/evm/observer/inbound.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

GitHub Check: codecov/patch
pkg/ticker/ticker.go

[warning] 69-70: pkg/ticker/ticker.go#L69-L70
Added lines #L69 - L70 were not covered by tests


[warning] 96-96: pkg/ticker/ticker.go#L96
Added line #L96 was not covered by tests


[warning] 120-120: pkg/ticker/ticker.go#L120
Added line #L120 was not covered by tests

zetaclient/chains/evm/observer/inbound.go

[warning] 48-51: zetaclient/chains/evm/observer/inbound.go#L48-L51
Added lines #L48 - L51 were not covered by tests


[warning] 53-53: zetaclient/chains/evm/observer/inbound.go#L53
Added line #L53 was not covered by tests


[warning] 55-56: zetaclient/chains/evm/observer/inbound.go#L55-L56
Added lines #L55 - L56 were not covered by tests


[warning] 60-61: zetaclient/chains/evm/observer/inbound.go#L60-L61
Added lines #L60 - L61 were not covered by tests


[warning] 64-65: zetaclient/chains/evm/observer/inbound.go#L64-L65
Added lines #L64 - L65 were not covered by tests


[warning] 67-67: zetaclient/chains/evm/observer/inbound.go#L67
Added line #L67 was not covered by tests


[warning] 70-75: zetaclient/chains/evm/observer/inbound.go#L70-L75
Added lines #L70 - L75 were not covered by tests


[warning] 77-77: zetaclient/chains/evm/observer/inbound.go#L77
Added line #L77 was not covered by tests

Additional comments not posted (2)
pkg/ticker/ticker.go (2)

127-139: Optimize Stop method.

The Stop method can be optimized by reducing the number of mutex locks and simplifying the logic.

func (t *Ticker) Stop() {
	t.stateMu.Lock()
	defer t.stateMu.Unlock()

	// noop
	if t.stopped || t.signalChan == nil {
		return
	}

	close(t.signalChan)
	t.stopped = true
}

Likely invalid or redundant comment.


113-125: Optimize SetInterval method.

The SetInterval method can be optimized by reducing the number of mutex locks and simplifying the logic.

func (t *Ticker) SetInterval(interval time.Duration) {
	t.stateMu.Lock()
	defer t.stateMu.Unlock()

	// noop
	if t.interval == interval || t.ticker == nil {
		return
	}

	t.interval = interval
	t.ticker.Reset(interval)
}

Likely invalid or redundant comment.

Tools
GitHub Check: codecov/patch

[warning] 120-120: pkg/ticker/ticker.go#L120
Added line #L120 was not covered by tests

pkg/ticker/ticker.go Outdated Show resolved Hide resolved
pkg/ticker/ticker.go Outdated Show resolved Hide resolved
pkg/ticker/ticker_test.go Show resolved Hide resolved
pkg/ticker/ticker_test.go Show resolved Hide resolved
pkg/ticker/ticker_test.go Show resolved Hide resolved
pkg/ticker/ticker_test.go Show resolved Hide resolved
zetaclient/chains/evm/observer/inbound.go Outdated Show resolved Hide resolved
zetaclient/chains/evm/observer/inbound.go Show resolved Hide resolved
zetaclient/chains/evm/observer/inbound.go Show resolved Hide resolved
zetaclient/chains/evm/observer/inbound.go Outdated Show resolved Hide resolved
pkg/ticker/ticker.go Outdated Show resolved Hide resolved
zetaclient/chains/evm/observer/inbound.go Outdated Show resolved Hide resolved
Copy link
Contributor

@kingpinXD kingpinXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to understand what is the motivation behind this package? Is there a specific functionality not present in the standard ticker/dynamic ticker that we needed ?

@swift1337
Copy link
Contributor Author

Trying to understand what is the motivation behind this package? Is there a specific functionality not present in the standard ticker/dynamic ticker that we needed ?

@kingpinXD

  • this package supports automatic first run. If duration=10s, (dynamic)ticker will be idle for 10s and only then do a first run
  • it also handles panics
  • it allows to have arbitrary call of Task func (ctx context.Conte, t *ticker.Ticker) error without repeating the code with checking for ctx cancellation and other stuff

Copy link
Contributor

@kingpinXD kingpinXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm ,
Can we add an issue to remove the DynamicTicker usage , if that's the next step for this task

pkg/ticker/ticker.go Show resolved Hide resolved
pkg/ticker/ticker.go Show resolved Hide resolved
pkg/ticker/ticker.go Show resolved Hide resolved
@swift1337 swift1337 enabled auto-merge August 6, 2024 16:50
@swift1337 swift1337 added this pull request to the merge queue Aug 6, 2024
Merged via the queue into develop with commit 4e6b821 Aug 6, 2024
27 of 28 checks passed
@swift1337 swift1337 deleted the feat/pkg-ticker branch August 6, 2024 17:21
gartnera pushed a commit that referenced this pull request Aug 15, 2024
* Add `pkg/ticker`

* Sample ticker usage in evm observer

* Change naming

* Address PR comments

* Address PR comments
gartnera pushed a commit that referenced this pull request Aug 15, 2024
* Add `pkg/ticker`

* Sample ticker usage in evm observer

* Change naming

* Address PR comments

* Address PR comments
gartnera pushed a commit that referenced this pull request Aug 15, 2024
* Add `pkg/ticker`

* Sample ticker usage in evm observer

* Change naming

* Address PR comments

* Address PR comments
gartnera added a commit that referenced this pull request Aug 16, 2024
* feat: parse inscription like witness data (#2524)

* parse inscription like witness data

* more comment

* remove unused code

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pull origin

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* review feedbacks

* update review feedbacks

* update make generate

* fix linter

* remove over flow

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* update review feedback

* update code commnet

* update comment

* more comments

* Update changelog.md

---------

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

fix version

* feat: detect memo in btc txn from OP_RETURN and inscription (#2533)

* parse inscription like witness data

* more comment

* remove unused code

* parse inscription

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pull origin

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* review feedbacks

* update review feedbacks

* add mainnet txn

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* parse inscription like witness data

* more comment

* remove unused code

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: Dmitry S <[email protected]>

* Update zetaclient/chains/bitcoin/tx_script.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* pull origin

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Dmitry S <[email protected]>

* review feedbacks

* update review feedbacks

* update make generate

* fix linter

* remove over flow

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/tokenizer.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* update review feedback

* update code commnet

* update comment

* more comments

* Update changelog.md

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* Update zetaclient/chains/bitcoin/observer/inbound.go

Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* clean up

* format code

---------

Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>

* refactor(zetaclient)!: improve AppContext (#2568)

* Implement chain registry

* Rewrite test-cases for AppContext

* Drop `supplychecker`

* Refactor app ctx Update worker

* Refactor orchestrator

* Refactor observer&signer; DROP postBlockHeaders

* Fix test cases [1]

* Update changelog

* Allow Zeta Chain in appContext; address PR comments [1]

* Fix app context update

* Check for `chain.IsZeta()`

* Add AppContext.FilterChains

* Fix test cases [2]

* Fix test cases [3]

* Address PR comments [1]

* Address PR comments [2]

* Add tests for `slices`

* Fix e2e tests [1]

* Fix e2e tests [2]

* Resolve conflicts, converge codebase between PRs

* Add lodash; remove slices pkg

* Address PR comments

* Minor logging fix

* Address PR comments

tmp

* feat(zetaclient): add generic rpc metrics (#2597)

* feat(zetaclient): add generic rpc metrics

* feedback

* changelog

* fmt

* fix(zetaclient): use name in pending tx metric (#2642)

* feat(pkg): add `ticker` package (#2617)

* Add `pkg/ticker`

* Sample ticker usage in evm observer

* Change naming

* Address PR comments

* Address PR comments

* feat(zetaclient)!: Add support for EIP-1559 gas fees (#2634)

* Add Gas struct

* Add EIP-1559 fees

* Update changelog

* Add test cases for legacy vs dynamicFee txs

* Fix typo; Add E2E coverage

* Address PR comments

* Address PR comments

* Use gasFeeCap formula

* Revert "Use gasFeeCap formula"

This reverts commit 2260925.

* Address PR comments

* Fix e2e upgrade tests

* fix: adjust evm outbound tracker reporter to avoid submitting invalid hashes (#2628)

* refactor and fix evm outbound tracker reporter to avoid invalid hashes; print log when outbound tracker is full of invalid hashes

* add changelog entry

* used predefined log fields

* remove repeated fields information from log message; Devops team would configure Datadog to show the fields

* remove redundant fields in log message; unified logs

* remove pending transaction map from observer; the outbound tracker reporter will no longer report pending hash

* use bg.Work() to launch outbound tracker reporter goroutines

* bring the checking EnsureNoTrackers() back

* add more rationale to EVM outbound tracker submission

* sync observer and signers without wait on startup

* try fixing tss migration E2E failure by increase timeout

* feat: Solana relayer (fee payer) key importer, encryption and decryption (#2673)

* configure observer relayer key for Solana; remove hardcoded solana test key from zetaclient code

* implementation of relayer key importer, encryption and decryption

* integrate relayer key into E2E and Solana signer

* add relayer_key_balance metrics and unit tests

* use TrimSpace to trim password

* add changelog entry

* use relayer account array in E2E config; a few renaming; add private key validation when importing

* fix linter

* remove GetNetworkName method for simplification

* added PromptPassword method to prompt single password

* use network name as map index to store relayer key passwords

* moved relayer passwords to chain registry

* airdrop SOL token only if solana local node is available

---------

Co-authored-by: Lucas Bertrand <[email protected]>

* ci: Set Docker Workflow to use Go 1.22 (#2722)

* Set go 1.22.2

* Set go 1.22.2

* Set go 1.22

* Set go 1.22

* Refactor contrib/rpc and contrib/docker-scripts to use snapshots API (#2724)

Co-authored-by: Julian Rubino <[email protected]>

---------

Co-authored-by: dev-bitSmiley <[email protected]>
Co-authored-by: Dmitry S <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
Co-authored-by: Charlie Chen <[email protected]>
Co-authored-by: Lucas Bertrand <[email protected]>
Co-authored-by: Charlie <[email protected]>
Co-authored-by: Julian Rubino <[email protected]>
Co-authored-by: Julian Rubino <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Code quality improvement no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants