Giter VIP home page Giter VIP logo

arc's People

Contributors

aaronkutch avatar albertchon avatar alpe avatar antstalepresh avatar cgdusek avatar chaudharyshiva18 avatar christianborst avatar dependabot[bot] avatar devashishdxt avatar dusan-maksimovic avatar dzmitryhil avatar ethanfrey avatar fedekunze avatar gadost avatar humanalgorithm avatar jackzampolin avatar jkilpatr avatar jtremback avatar kennethaltheasystems avatar kobs30 avatar laloquidity avatar leviathanbeak avatar mankenavenkatesh avatar mossid avatar neacsu avatar okwme avatar stana-miric avatar tac0turtle avatar yoongbok-lee avatar zmanian avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arc's Issues

Refactor relayer config

  • Refactor relayer config to have clear blocks such as, orchestrator, relayer[batch, valset, logicacll] with the child configs, instead of log one variable config such as "batch_relaying_mode".
  • Try to reduce the batch_request_mode since we have the batch_relaying_mode which should cover both

Add min-fee param for the batch relayer

Add and start checking for the batch min-fee pararm on the orchsestrator/relayer side.

  • The param is a param of the gbt config toml file.
  • This param should be optional - if not provided we accept all batches
  • And example of the param is: 100anom,20stake. Means we should support a list of fees. This state is possible because we allow fee denom change, so to forse it we should implement it this way.
  • If the total fee of a batch < min-fee the batch should be skipped.
  • It is better to filter the batches on the cosmos rather then on the relayer side.

This issue can be done from the "native-reward" base branch.

Add remote_stress_test

Add a new integration test to the orchestrator - remote_stress_test, which we will use to load the real chain (testnet).
This test should be based on "BATCH_STRESS/transaction_stress_test" test. But with some adjustments.

  • The test execution should take less than 1ETH, the less the better.
  • The test should read some EVN variables and use the default values if a variable is not provided:
    • ADDRESS_PREFIX, STAKING_TOKEN, COSMOS_NODE_GRPC, COSMOS_NODE_ABCI, ETH_NODE - are already configured in test_runner/main.rs to read ENV or default. Be we need to adjust test behavior:
      • If COSMOS_NODE_GRPC and COSMOS_NODE_ABCI are provided the test shouldn't launch the gravity chain and use the provided COSMOS_NODE_* connections.
      • If ETH_NODE is provided the test shouldn't launch the geth and use the provided ETH_NODE connection.
    • GRAVITY_ADDRESS - the address of the gravity contract. If the address is provided use that address for the test.
    • NUM_USERS - the number of users who participate in the test (by default 100) (the constant already exists in the BATCH_STRESS test)
    • MINER_PRIVATE_KEY - the private key which is used for the contract deployment (the constant already exists in the tests)
      Also, that test should be integrated to all-up-test.sh -> REMOTE_STRESS and workflows/integration-tests.yml with the default variable values, because we will adjust it in the future and need to see that it works fine with the adjustments.

In case you will have to change the global defaults variables, it is ok.

The state of different bridges

This is a tracking issue for the state of the different bridge ports.

Moonbeam: merged as a branch https://github.com/onomyprotocol/cosmos-gravity-bridge/tree/moonbeam. Latest progress on https://github.com/AaronKutch/cosmos-gravity-bridge/tree/moonbeam

Fantom (go-opera): merged as a branch https://github.com/onomyprotocol/cosmos-gravity-bridge/tree/fantom
The only real issue currently is Fantom-foundation/go-opera#374. My branch is https://github.com/AaronKutch/cosmos-gravity-bridge/tree/fantom

Polygon (bor): merged as a branch https://github.com/onomyprotocol/cosmos-gravity-bridge/tree/polygon .

Near-Aurora: has its own repo https://github.com/onomyprotocol/near-aurora-bridge
This is a few months out of date and needs to be rebased.

Neon: Almost done, encountering too few topics in strange error https://github.com/AaronKutch/cosmos-gravity-bridge/tree/neon

AVAX (avalanchego): merged as a branch https://github.com/onomyprotocol/arc/tree/avax

BNB: merged as a branch https://github.com/onomyprotocol/arc/tree/bnb

AVAX bridge happy path test

Replace ETH geth in the integration test and emulate the happy-path integration test for the Avalanche chain.
The replacement might be done in the docker like in the current repo or docker-compose like in the near-aurora bridge..
The AVAX repositories: https://github.com/ava-labs
Use the new branch "ava" branch to keep changes.
The good point to start is to run the localnet in the docker with some initial balance on account

use `ibc-go/v4`

This is a reminder to myself that when we update arc for a consumer chain that we need this

fix `INVALID_EVENTS` on CI for `bnb` branch

For some reason, INVALID_EVENTS is hanging in the CI when it isn't locally. It isn't failing on the same nonce every time, which means there is some weird race condition.

Use 18digits power reduction

Set power reduction value eq 18 instead of 6 and fix tests (the problems will be with the AIRDROP test because the test constants are based on the current stake values). We need it to integrate the bridge tests with the onomy chain tests.

fix docker caching

I noticed in the Actions CI that deprecated warnings are showing, and it seems the action-docker-layer-caching repo is unmaintained. We need to find a new caching method before July 2023

Improve orchestrator dependencies

  • Fix the ordering in dependencies in all Cargo files to follow the same pattern
  • Validate whether we need all of them and remove redundant

Orchestrator metrics

We need to add an option for the orchestrator to expose Prometheus metrics, in order to understand whether the orchestrator works or not. We need generic RUST metrics, and custom as well, for example, current nonce on the gravity and so on. It should be possible to set the host and port for the metrics.

Encrypt orchestrator passwords


Remove all instances of logging secret keys in plaintext. Ensure that all secret data are saved
in encrypted form. See OWASP’s key storage best practices for a brief description.


We can use password-based encryption as a first option.
In order to simplify the support, the description should be implemented similar to the cosmos pass encryption.
https://docs.cosmos.network/master/run-node/keyring.html#the-pass-backend


It is also possible to stop saving the keys and showing the generated keys at all. In that case, the keys might be encrypted and stored by the OS, for example using pass. And then it will be the user/script's responsibility to extract it and use it as a variable for the gbt.

Update the valset reward docs

Update the "valset reward" docs with a details description of the new way of the reward reception.
This issue can be done from the "native-reward" base branch.

Other relaying considerations

In PR #104 the most important finalization change is check_for_events in ethereum_event_watcher.rs, but I searched through the code and found get_last_checked_block and find_latest_valset that also relay information from the ethereum side. Before any of my changes, the latter two were coded to just use the latest changes, and I am suspicious of them. get_last_checked_block is concerning because it is used twice in a nested pattern in eth_oracle_main_loop, and I don't know if the possible implications of a invalidation from a reorg have been analyzed. find_latest_valset is also in the same situation, what would happen if a valset update was invalidated? For now I have changed them to used finalized blocks, and the test on ava-bridge doesn't show any problems I haven't already encountered from before the change. find_latest_valset delays results by no more than 20 minutes on the different chains, so I think I haven't introduced significant problems there.

Remove minimum block delay check

I didn't realize that there were race conditions both ways, Neon produces a block for every event. I will simply remove the condition altogether, I added it initially because PoS was a new thing, but now I don't think we need the extra failsafe

Update the batch reward docs

Update the "batch reward" docs with a details description of the new way of the reward reception.
This issue can be done from the "native-reward" base branch.

Fantom bridge happy path test

Replace ETH geth in the integration test and emulate the happy-path integration test for the Fantom chain.
The replacement might be done in the docker like in the current repo or docker-compose like in the near-aurora bridge..
The Fantom repositories: https://github.com/Fantom-Foundation
Use the new branch "fantom" branch to keep changes.
The good point to start is to run the localnet in the docker with some initial balance on account

Enhance error/warning logging and handling

  • Validate all errors types (had to create one more RecoverableError, potentially we don't need it, and just should refactor the use case where it is used)
  • There are warn! or error! multiline usage after with we return an error. So we need to validate whether we can put the error!
  • Discuss the errors list in the GravityBridge and start using them they work for us

Review v1.4.1 orchestrator changes

Review the differences between the current "main" branch and Gravity-Bridge with tag v1.4.1.
The main focus should be on the parts where we have conflicts and I had to do fix them.
In case you find an issue it is possible to fix it fast then do it. If the fix is complex then create a new issue for it. Also if you find a point to improve then create a new issue with the description.

In case of RPC error sendToCosmos client prints INFO instead of an error.

In case of RPC error sendToCosmos client prints INFO instead of an error. And say "Your tokens should show up in the account" which is a lie.

[2022-02-22T11:05:27Z INFO  gbt::client::eth_to_cosmos] Sending 10000000000000000000 / 0xFab46E002BbF0b4509813474841E0716E6730136 to Cosmos from 0x2d9480eBA3A001033a0B8c3Df26039FD3433D55d to onomy104n3g00hms7kycg54jml24s84jjt9s2agq6r07
[2022-02-22T11:05:32Z INFO  gbt::client::eth_to_cosmos] Failed to send tokens! RpcError(JsonRpcError { code: -32000, message: "replacement transaction underpriced", data: "None" })
[2022-02-22T11:05:32Z INFO  gbt::client::eth_to_cosmos] Your tokens should show up in the account onomy104n3g00hms7kycg54jml24s84jjt9s2agq6r07 on Gravity Bridge within 5 minutes

Add additional reward-recipient param for the orchestrator/relayer

Now the orchestrator/relayer uses the orchestrator cosmos address to receive the (valset) reward.
We need to add an additional reward-recipient param for the orchestrator/relayer and use it to receive the reward.
This "reward-recipient" param is optional, but if provided it should be used instead of the "orchestrator" address for as a reward_recipient.

This issue can be done from the "native-reward" base branch.

Replace ATOM and Graviton with ANOM

Replace atom and graviton denom in code to anom since the onmy chain primary token is anom.
Also pay attention that anom uses 6digits, anom uses 18.

Refactor the ethereum_events.rs (Ethereum event parser).

Refactor the ethereum_events.rs code. Now, most of the methods have code duplication and parse the events in a weird manner one attribute by one (incrementing the next byte index), which makes the support extremely hard, because the change of the first lines of the code significantly changes the following code.

The refactored code should either use ABI-generated code to parser the events or a number of functions to parse the events attribute by index, like here.
Also, it should validate and return the details errors if case any of the sub-decoding functions return an error.

All methods of the "ethereum_events.rs" must be covered by unit tests. The input data might be taken from the solidity tests.

This issue can be done from the "native-reward" base branch.

Ethereum ABI docs

Fix `test_valset_update()`

this test fails sometimes due to badly constructed logic within the test itself,

the comment says it all:

// this is hacky and not really a good way to test validator set updates in a highly
    // repeatable fashion. What we really need to do is be aware of the total staking state
    // and manipulate the validator set very intentionally rather than kinda blindly like
    // we are here. For example the more your run this function the less this fixed amount
    // makes any difference, eventually it will fail because the change to the total staked
    // percentage is too small.

Checked subtract panic when the latest block number is less than the block delay

This is a problem I will fix, where https://github.com/onomyprotocol/cosmos-gravity-bridge/blob/8cbc8bcf2aead49ed02a68586fe312269bb3d8ec/orchestrator/orchestrator/src/ethereum_event_watcher.rs#L44 panics if the latest block number is less than the block delay. This shouldn't happen in practice, except I have experienced it because of bugs. We should return a proper error message in case this would happen in production (which could happen if something is misconfigured).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.