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

Dan/more cw agent remediations #2912

Merged

Conversation

daniel-savu
Copy link
Contributor

Description

Drive-by changes

Related issues

Backward compatibility

Testing

@daniel-savu daniel-savu changed the base branch from main to trevor/new-featv3-cosmos-oct-28 November 10, 2023 18:29
@daniel-savu daniel-savu marked this pull request as ready for review November 15, 2023 16:24
rust/Cargo.toml Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used taplo to reorder dependencies alphabetically, looks like it reordered all the keys alphabetically too

err: &mut ConfigParsingError,
default_rpc_consensus_type: &str,
) -> Option<ChainConnectionConf> {
if rpcs.len() <= 1 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to handle the case of it being len 0 where we'd I guess return None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are returning None on len 0 here, because next() will return None and map doesn't apply the closure to None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

however I agree this implementation could be cleaner, there's an unwrap in the else branch which relies on the assumption that we're checking the length. Trying to make this nicer

transaction_id: H256::from_slice(hex::decode(response.txhash)?.as_slice()).into(),
executed: response.code == 0,
gas_used: U256::from(response.gas_used),
gas_price: U256::from(response.gas_wanted),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this wasn't your change but the gas wanted is the gas limit for tx and not the gas price

I assume this was originally set like this because it wasn't available in TxResponse - imo it's fine to just set it to 1 or something for now (or to get it from the ceil of here https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/trevor/new-featv3-cosmos-oct-28/rust/chains/hyperlane-cosmos/src/providers/grpc.rs#L36, which is how we set the gas price atm - unfortunately there doesn't seem to be a reasonable way of getting it via RPC so atm it's just hardcoded :/), but to add a comment about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see :/ DEFAULT_GAS_PRICE isn't available here because it lives in hyperlane-cosmos, and the TryFrom implementation has to live in this crate due to the orphan rule. I'll just set it to U256::one()

@daniel-savu daniel-savu merged commit 5a9cd84 into trevor/new-featv3-cosmos-oct-28 Nov 21, 2023
@daniel-savu daniel-savu deleted the dan/more-cw-agent-remediations branch November 21, 2023 12:10
tkporter added a commit that referenced this pull request Nov 22, 2023
…e indexing fix (#2957)

### Description

Image from the latest PR to trevor/new-featv3-cosmos-oct-28, which is
#2912

This includes a fix to merkle tree indexing so it indexes it in the same
way as messages

### 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
-->
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.

2 participants