Skip to content

Commit

Permalink
Merge branch 'main' into ENG-995/refactor_sequencer_app
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanoroshiba committed Dec 5, 2024
2 parents f8f8f61 + fc10a63 commit 899394e
Show file tree
Hide file tree
Showing 140 changed files with 3,710 additions and 2,912 deletions.
6 changes: 6 additions & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ ignore = [
# `proc-macro-error` is Unmaintained. It is a transient dependency of borsh crates, so cannot
# easily be replaced.
"RUSTSEC-2024-0370",
# `instant` is Unmaintained. It is a transient dependency of `isahc`, `wiremock` and `ethers`, so
# cannot easily be replaced.
"RUSTSEC-2024-0384",
# `derivative` is Unmaintained. It is a transient dependency of many crates including several
# penumbra ones, so cannot easily be replaced.
"RUSTSEC-2024-0388",
]
31 changes: 29 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ members = [
"crates/astria-conductor",
"crates/astria-config",
"crates/astria-core",
"crates/astria-core-address",
"crates/astria-core-consts",
"crates/astria-core-crypto",
"crates/astria-eyre",
"crates/astria-grpc-mock",
"crates/astria-grpc-mock-test",
Expand All @@ -34,6 +37,9 @@ default-members = [
"crates/astria-conductor",
"crates/astria-config",
"crates/astria-core",
"crates/astria-core-address",
"crates/astria-core-consts",
"crates/astria-core-crypto",
"crates/astria-grpc-mock",
"crates/astria-grpc-mock-test",
"crates/astria-grpc-mock-test-codegen",
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion charts/hermes/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.1
version: 0.5.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
20 changes: 9 additions & 11 deletions charts/hermes/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
log_level = '{{ .Values.global.logLevel }}'

[rest]

# Whether or not to enable the REST service. Default: false
enabled = {{ .Values.rest.enabled }}

Expand Down Expand Up @@ -110,6 +109,15 @@ trust_threshold = '{{ $chain.trustThreshold }}'
{{- if $chain.memoPrefix }}
memo_prefix = '{{ $chain.memoPrefix }}'
{{- end }}
{{- if $chain.feeGranter }}
fee_granter = '{{ $chain.feeGranter }}'
{{- end }}
{{- if $chain.compatMode }}
compat_mode = '{{ $chain.compatMode }}'
{{- end }}
{{- if $chain.clearInterval }}
clear_interval = '{{ $chain.clearInterval }}'
{{- end }}

{{- if $chain.packetFilter }}
{{- if $chain.packetFilter.policy }}
Expand All @@ -132,14 +140,4 @@ recv = [
{{- end }}
{{- end }}
{{- end }}
{{- if $chain.feeGranter }}
fee_granter = '{{ $chain.feeGranter }}'
{{- end }}
{{- if $chain.compatMode }}
compat_mode = '{{ $chain.compatMode }}'
{{- end }}
{{- if $chain.clearInterval }}
clear_interval = '{{ $chain.clearInterval }}'
{{- end }}

{{ end }}
2 changes: 1 addition & 1 deletion charts/hermes/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: {{ include "hermes.namespace" . }}
data:
config.toml: |
{{- tpl (.Files.Get "files/config.toml") $ | nindent 4 }}
{{- tpl (.Files.Get "files/config.toml") $ | nindent 4 }}
---
{{- if not .Values.secretProvider.enabled }}
{{- range $chainId, $chain := .Values.chains }}
Expand Down
4 changes: 2 additions & 2 deletions charts/hermes/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: hermes-relayer-metrics
name: {{ include "hermes.fullname" . }}-metrics
labels:
app: {{ include "hermes.fullname" . }}
{{- with .Values.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
jobLabel: hermes-relayer-metric
jobLabel: {{ include "hermes.fullname" . }}-metric
namespaceSelector:
matchNames:
- {{ include "hermes.namespace" . }}
Expand Down
42 changes: 5 additions & 37 deletions charts/ibc-test.just
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ run-without-native tag=defaultTag:
# Execute the transfer from Celestia to the Rollup
just ibc-test _do-ibc-transfer {{defaultNamespace}} {{sequencer_sudo_address}}

# Add transfer/channel-0/utia as fee-asset
docker run --rm --network host $ASTRIA_CLI_IMAGE sequencer sudo fee-asset add --private-key {{sequencer_sudo_pkey}} --asset transfer/channel-0/utia --sequencer-url {{sequencer_rpc_url}} --sequencer.chain-id {{sequencer_chain_id}}
# check that sequencer balance updated correctly

EXPECTED_BALANCE=$(echo "1 * {{transfer_amount}}" | bc)
for i in {1..50}
do
Expand All @@ -110,6 +107,11 @@ run-without-native tag=defaultTag:
exit 1
fi

# Add transfer/channel-0/utia as allowed fee-asset
docker run --rm --network host $ASTRIA_CLI_IMAGE sequencer sudo fee-asset add --private-key {{sequencer_sudo_pkey}} --asset transfer/channel-0/utia --sequencer-url {{sequencer_rpc_url}} --sequencer.chain-id {{sequencer_chain_id}}

# TODO: query allowd fee asset verifying succefull addition

[no-cd]
run tag=defaultTag:
#!/usr/bin/env bash
Expand Down Expand Up @@ -149,23 +151,6 @@ run tag=defaultTag:
# Execute the transfer from Celstia to sequencer with compat address
just ibc-test _do-ibc-transfer {{defaultNamespace}} {{compat_address}}

# check that celestia balance updated correctly
for i in {1..50}
do
current_celestia_balance=$(just ibc-test get-celestia-balance)
echo "check $i, balance: $current_celestia_balance, expected: $expected_celestia_balance"
if (( $expected_celestia_balance == $current_celestia_balance )); then
expected_celestia_balance_found="1"
break
else
sleep 1
fi
done
if [[ -z $expected_celestia_balance_found ]]; then
echo "expected celestia balance was not found after withdraw; IBC transfer from Celestia to the Rollup failed"
exit 1
fi

# check that sequencer balance updated correctly
ASTRIA_CLI_IMAGE="{{cli_image}}{{ if tag != '' { replace(':#', '#', tag) } else { '' } }}"
EXPECTED_BALANCE=$(echo "1 * {{transfer_amount}}" | bc)
Expand Down Expand Up @@ -283,23 +268,6 @@ run-timeout tag=defaultTag:
# Execute the transfer from Celstia to sequencer with compat address
just ibc-test _do-ibc-transfer {{defaultNamespace}} {{compat_address}}

# check that celestia balance updated correctly
for i in {1..50}
do
current_celestia_balance=$(just ibc-test get-celestia-balance)
echo "check $i, balance: $current_celestia_balance, expected: $expected_celestia_balance"
if (( $expected_celestia_balance == $current_celestia_balance )); then
expected_celestia_balance_found="1"
break
else
sleep 1
fi
done
if [[ -z $expected_celestia_balance_found ]]; then
echo "expected celestia balance was not found after withdraw; IBC transfer from Celestia to the Rollup failed"
exit 1
fi

# check that sequencer balance updated correctly
ASTRIA_CLI_IMAGE="{{cli_image}}{{ if tag != '' { replace(':#', '#', tag) } else { '' } }}"
EXPECTED_BALANCE=$(echo "1 * {{transfer_amount}}" | bc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
time::Duration,
};

use astria_core::generated::sequencerblock::v1::sequencer_service_client::SequencerServiceClient;
use astria_core::generated::astria::sequencerblock::v1::sequencer_service_client::SequencerServiceClient;
use astria_eyre::eyre::{
self,
WrapErr as _,
Expand Down
19 changes: 10 additions & 9 deletions crates/astria-bridge-withdrawer/src/bridge_withdrawer/startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
};

use astria_core::{
generated::sequencerblock::v1::sequencer_service_client::{
generated::astria::sequencerblock::v1::sequencer_service_client::{
self,
SequencerServiceClient,
},
Expand Down Expand Up @@ -270,20 +270,21 @@ impl Startup {
the sequencer logic."
);

let proto_tx = astria_core::generated::protocol::transaction::v1::Transaction::decode(
&*last_transaction.tx,
)
.wrap_err_with(|| {
format!(
let proto_tx =
astria_core::generated::astria::protocol::transaction::v1::Transaction::decode(
&*last_transaction.tx,
)
.wrap_err_with(|| {
format!(
"failed to decode data in Sequencer CometBFT transaction as `{}`",
astria_core::generated::protocol::transaction::v1::Transaction::full_name(),
astria_core::generated::astria::protocol::transaction::v1::Transaction::full_name(),
)
})?;
})?;

let tx = Transaction::try_from_raw(proto_tx).wrap_err_with(|| {
format!(
"failed to verify {}",
astria_core::generated::protocol::transaction::v1::Transaction::full_name()
astria_core::generated::astria::protocol::transaction::v1::Transaction::full_name()
)
})?;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use astria_core::generated::sequencerblock::v1::sequencer_service_client::SequencerServiceClient;
use astria_core::generated::astria::sequencerblock::v1::sequencer_service_client::SequencerServiceClient;
use astria_eyre::eyre::{
self,
Context as _,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
};

use astria_core::{
generated::sequencerblock::v1::{
generated::astria::sequencerblock::v1::{
sequencer_service_client::{
self,
SequencerServiceClient,
Expand All @@ -15,6 +15,7 @@ use astria_core::{
Action,
TransactionBody,
},
Protobuf as _,
};
use astria_eyre::eyre::{
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ fn prepare_broadcast_tx_sync_response(response: tx_sync::Response) -> Mock {

/// Convert a wiremock request to an astria transaction
pub fn tx_from_request(request: &wiremock::Request) -> Transaction {
use astria_core::generated::protocol::transaction::v1::Transaction as RawTransaction;
use astria_core::generated::astria::protocol::transaction::v1::Transaction as RawTransaction;
use prost::Message as _;

let wrapped_tx_sync_req: tendermint_rpc::request::Wrapper<tx_sync::Request> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use astria_core::{
self,
generated::sequencerblock::v1::{
generated::astria::sequencerblock::v1::{
sequencer_service_server::{
SequencerService,
SequencerServiceServer,
Expand Down
4 changes: 4 additions & 0 deletions crates/astria-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `fee-assets` subcommand to `sequencer` CLI [#1816](https://github.com/astriaorg/astria/pull/1816).

### Fixed

- Fixed ICS20 withdrawal source when using channel with more than one
Expand Down
7 changes: 6 additions & 1 deletion crates/astria-cli/src/sequencer/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ impl Create {
let signing_key = SigningKey::new(OsRng);
let pretty_signing_key = hex::encode(signing_key.as_bytes());
let pretty_verifying_key = hex::encode(signing_key.verification_key().as_bytes());
let pretty_address = SigningKey::try_address(&signing_key, &self.prefix)?;

let pretty_address: Address = Address::builder()
.array(signing_key.address_bytes())
.prefix(&self.prefix)
.try_build()?;

println!("Create Sequencer Account");
println!();
// TODO: don't print private keys to CLI, prefer writing to file:
Expand Down
Loading

0 comments on commit 899394e

Please sign in to comment.