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

Merge v3 into oct28 #2945

Closed
wants to merge 143 commits into from
Closed

Merge v3 into oct28 #2945

wants to merge 143 commits into from

Conversation

daniel-savu
Copy link
Contributor

fixes merge conflicts

tkporter and others added 15 commits November 2, 2023 11:20
…on Neutron (#2885)

### Description

Hopeful quick fix to indexing issues we're seeing. Leading theory is
that the tx_search is asking for a block range that the servicing RPC
node doesn't actually have state for.

Curious if @nambrot you feel we should go with a more conservative reorg
period, maybe 2 blocks?

My personal theory is that this isn't just bad RPC load balancing, but
that the tip that's returned is simply committed to but the state
transition hasn't yet been executed, see
https://github.com/CosmWasm/cosmwasm/blob/main/SEMANTICS.md#sdk-context

> First, the Tendermint engine will seek 2/3+ consensus on a list of
transactions to be included in the next block. This is done without
executing them. They are simply subjected to a minimal pre-filter by the
Cosmos SDK module, to ensure they are validly formatted transactions,
with sufficient gas fees, and signed by an account with sufficient fees
to pay it. Notably, this means many transactions that error may be
included in a block.
> Once a block is committed (typically every 5s or so), the transactions
are then fed to the Cosmos SDK sequentially in order to execute them.
Each one returns a result or error along with event logs, which are
recorded in the TxResults section of the next block. The AppHash (or
merkle proof or blockchain state) after executing the block is also
included in the next block.

### Drive-by changes

Fix a typo for `CosmosMerkleTreeHookIndexer`

### Related issues

n/a

### Backward compatibility

non breaking

### Testing

None 😛
### Description

Moves merkle tree hook insertion indexing away from the watermarked
contract sync to the same method that message indexing uses

* Generalizes all the MessageContractSync / MessageSyncCursor etc to
work with any "sequenced" data. Sequenced data means a data type that
has a sequence # that increases 1 at a time as it's created. E.g. a
message's nonce is its sequence, or a merkle tree insertion's leaf index
is its sequence

### Drive-by changes

Minor idiomatic changes

### Related issues

n/a

### Backward compatibility

I believe this is fully backward compatible

### Testing

Tested locally by running a relayer with an empty data dir & with an
existing data dir. Also tested a validator locally
### Description

* Stops creating a new client a bunch of times in rpc.rs (I haven't yet
changed grpc.rs - this is because the client's functions are `&mut
self`, so will have to think about what to do here)
* Changes `unwrap_or_none_result` to not include the `let Some(varname)`
bit so we can do `let varname = unwrap_or_none_result!(...)`
* Instead of a `get_parser(&self, ...)` fn that returns a closure, we
just pass a the function `Self::[data_type]_parser`
* Refactors these parsers to be a bit more defensive - e.g. each param
is represented as an Option so it's clear if one isn't parsed, and we
also get the `_contract_address` param (which is auto-set by the
cosmwasm runtime). It returns a `ParsedEvent<T>` so that we can return
the `_contract_address` in there too
* Refactors the range indexing in rpc.rs, including an important fix to
ensure that the contract address of an event is the one we actually want
to index

### Drive-by changes

n/a

### Related issues

n/a

### Backward compatibility

Fully

### Testing

Unit tests, ran locally
### Description

Delegates bech32 encoding, decoding, and cosmos address building from a
private key to cosmrs/tendermint upstream crates. The only place where
this wasn't doable was the tests, because of a cyclic dependency - left
a TODO comment there.

As part of this, renamed
`rust/chains/hyperlane-cosmos/src/libs/verify.rs` ->
`rust/chains/hyperlane-cosmos/src/libs/address.rs`

~~**Warning**: We should re-enable e2e and make sure everything still
works locally, since the actual `encode`/`decode` functions that end up
being called _are_ different~~

### Testing
Tested manually EVM <> Duality (both ways)
Removes cosmos signer unwraps by making the signer optional. Depends on
#2887
### Description

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
### Description

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
### Description

* Creates a single channel that's cloned (which can be done [cheaply and
is
encouraged](https://docs.rs/tonic/latest/tonic/transport/struct.Channel.html))
when creating a new client.
* general cleanup & renaming
* I believe a chain signer will not be required by e.g. the validator,
will confirm this locally

### Drive-by changes

n/a

### Related issues

n/a

### Backward compatibility

yee

### Testing

builds, local test
Size of rust build exceeds the storage space in the `ubuntu-latest`
runner. `larger-runner` has more storage, but let's see if it also has
all the system dependencies required to build
Adds "gas payment count" and "confirmed submitted messages" as
termination invariants to the cw run-locally, to get the test to
actually fail if messages are not delivered
### Description

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
### Description

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
### Description

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
Copy link

changeset-bot bot commented Nov 21, 2023

⚠️ No Changeset found

Latest commit: 7d6f4ce

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@daniel-savu daniel-savu force-pushed the dan/merge-v3-into-oct28 branch from 0b2d736 to 7d6f4ce Compare November 21, 2023 16:25
Base automatically changed from trevor/new-featv3-cosmos-oct-28 to main November 23, 2023 10:23
@daniel-savu daniel-savu deleted the dan/merge-v3-into-oct28 branch November 28, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants