injectivelabs / peggo Goto Github PK
View Code? Open in Web Editor NEWPeggo is a Go implementation of the Peggy Orchestrator for the Injective Chain
License: Apache License 2.0
Peggo is a Go implementation of the Peggy Orchestrator for the Injective Chain
License: Apache License 2.0
Hey @mankenavenkatesh could you please help fix the typo in these logs (in acitve set should be in active set).
In the current implementation of peggo orchestrator executable, when I start the peggo orchestrator and pass the cosmos passphrase via cli using --cosmos-from-passphrase option, it still prompts for keyring passphrase. It works as expected if I set the param in .env file and then start the peggo orchestrator. The peggo orchestrator starts without any further prompts.
I've tried a couple of troubleshooting steps as advised in discord which includes passing cosmos-keyring-dir , cosmos-from, cosmos-from-passphrase option but it didn't work.
I'm running the validator on an Amazon Linux 2 instance. Also see below the current binary version
sh-4.2$ peggo version
Version dev (c0cb909)
Compiled at 20220220-1014 using Go go1.17.6 (amd64)
sh-4.2$ injectived version
Version dev (30b3dbf)
Compiled at 20220220-1014 using Go go1.17.6 (amd64)
It's important to have monitoring and observability for peggo.
We should:
/// Send confirmation for an array of validator sets, it's far more efficient than to send these
as a single message
Following hardcoded settings increase Ethereum-based events detection on environments like our devnet to anything between a couple of minutes to 20 minutes, which makes it unfeasable for testing and test automation. Let's move them to env vars or a config file.
Settings in question:
main_loop.go
-> const defaultLoopDur
orchestrator/eth_event_watcher.go
-> const defaultBlocksToSearch
Health endpoint with HTTP 200 or embedded Prometheus exporter
Probably duplicate of InjectiveLabs/injective-chain-releases#47
Peggo should really use a mempool API and have a configuration allowing for a custom time delay offset for batch tx submission so that we don't have so many failed tx's.
E.g. Each one is ~$20+ flushed down the drain for no good reason
https://etherscan.io/address/0xdd14a1d791850ae9fdae9a29a0fe548b68f99116
Earlier orchestrator will register custom eth key.
In peggy-v2, Orchestrator will register delegate_eth_address
,our_valoper_address
, delegate_cosmos_address
It can be achieved by broadcasting SetOrchestratorAddressMsg
The current bridge UI is rather simple and does not provide users any visual indication of the progress of one's transfers.
We can use The Graph as a general purpose backend API for use by client-facing services as well as internal monitoring/alerting.
The station (and possibly also DEX) can use this API to show historical cross-chain deposits/withdrawals as well as real-time estimates for pending deposits.
SendToCosmosEvent
)submitBatch
)Although this won't be used by any mission critical services, having this nice GraphQL API can easily allow us to make sure Peggy is functioning properly. With this API, we can create monitoring bots or even a future analytics site which uses this API as well.
updateValset
function)ERC20DeployedEvent
)In the current BatchRequesterLoop, if the Coingecko API is down AND orchestrators have a non-zero minFeeInUSD
, then no batches will be requested aka no withdrawals back to Ethereum will occur.
peggo/orchestrator/main_loops.go
Lines 311 to 315 in dd5760b
peggo/orchestrator/main_loops.go
Lines 331 to 339 in dd5760b
Empirically I've noticed the Coingecko public API can be a bit flaky sometimes (at least in the trading bot's usage) so we shouldn't depend on it to function in order to process withdrawals. It's nice that we have retries currently at least but ideally, we should make this flow independent of whether Coingecko works or not, as it's entirely plausible that their API goes down for a day.
I propose the following change:
coingeckoPrices map[common.Address]float64
defined on the peggyOrchestrator
struct. This will keep a reasonably up to date mapping of the prices from Coingecko. The denoms for which this should be fetched are for any ERC-20 denom in the bank supplyCheckFeeThreshold
function to return the price from coingeckoPrices
if the s.priceFeeder.QueryUSDPrice
returns an error. So tokenPriceInUSD, err := s.priceFeeder.QueryUSDPrice(erc20Contract)
if err != nil {
price, ok := s.coingeckoPrices[erc20Contract]
if ok {
tokenPriceInUSD = price
} else {
return false
}
}
Note: currently this isn't an issue since we're running the orchestrators with a 0 minFeeInUSD
setting but in the future we should change this in order to increase the economic robustness of the bridge.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.