Skip to content

Commit

Permalink
Merge branch 'main' into ENG-1004/trace_prefixed_deposits
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanoroshiba committed Nov 18, 2024
2 parents cf27373 + 740d9e7 commit f875e46
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 40 deletions.
6 changes: 4 additions & 2 deletions charts/celestia-local/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ 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.6.4
version: 0.7.0

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.9.0"
appVersion: "2.3.1"

maintainers:
- name: wafflesvonmaple
url: astria.org
- name: steezeburger
url: astria.org
- name: quasystaty1
url: astria.org
- name: joroshiba
url: astria.org
4 changes: 2 additions & 2 deletions charts/celestia-local/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ storage:
persistentVolumeName: "celestia-shared-storage"
path: "/data/celestia-data"

celestiaAppImage: "ghcr.io/celestiaorg/celestia-app:v2.0.0"
celestiaNodeImage: "ghcr.io/celestiaorg/celestia-node:v0.16.0-rc0"
celestiaAppImage: "ghcr.io/celestiaorg/celestia-app:v2.3.1"
celestiaNodeImage: "ghcr.io/celestiaorg/celestia-node:v0.18.3-mocha"

podSecurityContext:
runAsUser: 10001
Expand Down
4 changes: 2 additions & 2 deletions charts/celestia-node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ 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.3.6
version: 0.4.0

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.14.1"
appVersion: "0.18.3"

maintainers:
- name: wafflesvonmaple
Expand Down
10 changes: 7 additions & 3 deletions charts/celestia-node/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
GRPCPort = "9090"

[State]
KeyringAccName = ""
KeyringBackend = "test"
DefaultKeyName = "my_celes_key"
DefaultBackendName = "test"

[P2P]
ListenAddresses = ["/ip4/0.0.0.0/udp/2121/quic-v1", "/ip6/::/udp/2121/quic-v1", "/ip4/0.0.0.0/tcp/2121", "/ip6/::/tcp/2121"]
Expand Down Expand Up @@ -46,7 +46,10 @@
Enabled = false

[Share]
BlockStoreCacheSize = 128
UseShareExchange = true
[Share.EDSStoreParams]
RecentBlocksCacheSize = 10
[Share.ShrExEDSParams]
ServerReadTimeout = "5s"
ServerWriteTimeout = "1m0s"
Expand Down Expand Up @@ -103,4 +106,5 @@
SampleTimeout = "3m0s"
{{- end }}


[Pruner]
EnableService = {{ .Values.config.enablePruner }}
3 changes: 2 additions & 1 deletion charts/celestia-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config:
network: mocha-4
chainId: mocha-4
coreIp: "full.consensus.mocha-4.celestia-mocha.com"
enablePruner: false
type: light
tokenAuthLevel: read # can set to nil or false to disable rpc auth
coreGrpcPort: 9090
Expand All @@ -19,7 +20,7 @@ config:

images:
pullPolicy: IfNotPresent
node: ghcr.io/celestiaorg/celestia-node:v0.16.0-rc0
node: ghcr.io/celestiaorg/celestia-node:v0.18.3-mocha

ports:
celestia:
Expand Down
6 changes: 3 additions & 3 deletions charts/evm-stack/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- name: celestia-node
repository: file://../celestia-node
version: 0.3.6
version: 0.4.0
- name: evm-rollup
repository: file://../evm-rollup
version: 1.0.0
Expand All @@ -20,5 +20,5 @@ dependencies:
- name: blockscout-stack
repository: https://blockscout.github.io/helm-charts
version: 1.6.8
digest: sha256:d7d13d546b7c02594756cc24511f95316bd9e8664a5d336b551e22e70332a0d8
generated: "2024-11-07T11:31:10.563322+02:00"
digest: sha256:618d0978ce1fa169bffa360010e8afeb06f21ffb7574e8a298d1d561bbcee05b
generated: "2024-11-11T13:27:42.868678+02:00"
4 changes: 2 additions & 2 deletions charts/evm-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ 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: 1.0.2
version: 1.0.3

dependencies:
- name: celestia-node
version: 0.3.6
version: 0.4.0
repository: "file://../celestia-node"
condition: celestia-node.enabled
- name: evm-rollup
Expand Down
1 change: 1 addition & 0 deletions crates/astria-sequencer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Index all event attributes [#1786](https://github.com/astriaorg/astria/pull/1786).
- Ensure all deposit assets are trace prefixed [#1807](https://github.com/astriaorg/astria/pull/1807).

## [1.0.0] - 2024-10-25
Expand Down
11 changes: 10 additions & 1 deletion crates/astria-sequencer/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,16 @@ impl App {
.iter()
.any(|act| act.is_fee_asset_change() || act.is_fee_change());

Ok(state_tx.apply().1)
// index all event attributes
let mut events = state_tx.apply().1;
for event in &mut events {
event
.attributes
.iter_mut()
.for_each(|attr| attr.index = true);
}

Ok(events)
}

#[instrument(name = "App::end_block", skip_all)]
Expand Down
51 changes: 51 additions & 0 deletions crates/astria-sequencer/src/app/tests_execute_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,3 +1278,54 @@ async fn transaction_execution_records_fee_event() {
assert_eq!(event.attributes[2].key, "feeAmount");
assert_eq!(event.attributes[3].key, "positionInTransaction");
}

#[tokio::test]
async fn ensure_all_event_attributes_are_indexed() {
let mut app = initialize_app(None, vec![]).await;
let mut state_tx = StateDelta::new(app.state.clone());

let alice = get_alice_signing_key();
let bob_address = astria_address_from_hex_string(BOB_ADDRESS);
let value = 333_333;
state_tx
.put_bridge_account_rollup_id(&bob_address, [0; 32].into())
.unwrap();
state_tx.put_allowed_fee_asset(&nria()).unwrap();
state_tx
.put_bridge_account_ibc_asset(&bob_address, nria())
.unwrap();
app.apply(state_tx);

let transfer_action = Transfer {
to: bob_address,
amount: value,
asset: nria().into(),
fee_asset: nria().into(),
};
let bridge_lock_action = BridgeLock {
to: bob_address,
amount: 1,
asset: nria().into(),
fee_asset: nria().into(),
destination_chain_address: "test_chain_address".to_string(),
};
let tx = TransactionBody::builder()
.actions(vec![transfer_action.into(), bridge_lock_action.into()])
.chain_id("test")
.try_build()
.unwrap();

let signed_tx = Arc::new(tx.sign(&alice));
let events = app.execute_transaction(signed_tx).await.unwrap();

events
.iter()
.flat_map(|event| &event.attributes)
.for_each(|attribute| {
assert!(
attribute.index,
"attribute {} is not indexed",
attribute.key,
);
});
}
13 changes: 5 additions & 8 deletions crates/astria-sequencer/src/fees/state_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ use cnidarium::{
};
use futures::Stream;
use pin_project_lite::pin_project;
use tendermint::abci::{
Event,
EventAttributeIndexExt as _,
};
use tendermint::abci::Event;
use tracing::instrument;

use super::{
Expand Down Expand Up @@ -574,10 +571,10 @@ fn construct_tx_fee_event(fee: &Fee) -> Event {
Event::new(
"tx.fees",
[
("actionName", fee.action_name.to_string()).index(),
("asset", fee.asset.to_string()).index(),
("feeAmount", fee.amount.to_string()).index(),
("positionInTransaction", fee.source_action_index.to_string()).index(),
("actionName", fee.action_name.to_string()),
("asset", fee.asset.to_string()),
("feeAmount", fee.amount.to_string()),
("positionInTransaction", fee.source_action_index.to_string()),
],
)
}
Expand Down
17 changes: 7 additions & 10 deletions crates/astria-sequencer/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use astria_eyre::eyre::{
};
use tendermint::abci::{
self,
EventAttributeIndexExt as _,
};

pub(crate) fn cometbft_to_sequencer_validator(
Expand All @@ -31,21 +30,19 @@ pub(crate) fn create_deposit_event(deposit: &Deposit) -> abci::Event {
abci::Event::new(
"tx.deposit",
[
("bridgeAddress", deposit.bridge_address.to_string()).index(),
("rollupId", deposit.rollup_id.to_string()).index(),
("amount", deposit.amount.to_string()).index(),
("asset", deposit.asset.to_string()).index(),
("bridgeAddress", deposit.bridge_address.to_string()),
("rollupId", deposit.rollup_id.to_string()),
("amount", deposit.amount.to_string()),
("asset", deposit.asset.to_string()),
(
"destinationChainAddress",
deposit.destination_chain_address.to_string(),
)
.index(),
),
(
"sourceTransactionId",
deposit.source_transaction_id.to_string(),
)
.index(),
("sourceActionIndex", deposit.source_action_index.to_string()).index(),
),
("sourceActionIndex", deposit.source_action_index.to_string()),
],
)
}
Expand Down
42 changes: 36 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,42 @@ default_docker_tag := 'local'
default_repo_name := 'ghcr.io/astriaorg'

# Builds docker image for the crate. Defaults to 'local' tag.
docker-build crate tag=default_docker_tag repo_name=default_repo_name:
docker buildx build --load --build-arg TARGETBINARY={{crate}} -f containerfiles/Dockerfile -t {{repo_name}}/$(sed 's/^[^-]*-//' <<< {{crate}}):{{tag}} .

docker-build-and-load crate tag=default_docker_tag repo_name=default_repo_name:
@just docker-build {{crate}} {{tag}} {{repo_name}}
@just load-image $(sed 's/^[^-]*-//' <<< {{crate}}) {{tag}} {{repo_name}}
# NOTE: `_crate_short_name` is invoked as dependency of this command so that failure to pass a valid
# binary will produce a meaningful error message.
docker-build crate tag=default_docker_tag repo_name=default_repo_name: (_crate_short_name crate "quiet")
#!/usr/bin/env sh
set -eu
short_name=$(just _crate_short_name {{crate}})
set -x
docker buildx build --load --build-arg TARGETBINARY={{crate}} -f containerfiles/Dockerfile -t {{repo_name}}/$short_name:{{tag}} .
# Builds and loads docker image for the crate. Defaults to 'local' tag.
# NOTE: `_crate_short_name` is invoked as dependency of this command so that failure to pass a valid
# binary will produce a meaningful error message.
docker-build-and-load crate tag=default_docker_tag repo_name=default_repo_name: (_crate_short_name crate "quiet")
#!/usr/bin/env sh
set -eu
short_name=$(just _crate_short_name {{crate}})
set -x
just docker-build {{crate}} {{tag}} {{repo_name}}
just load-image $short_name {{tag}} {{repo_name}}
# Maps a crate name to the shortened name used in the docker tag.
# If `quiet` is an empty string the shortened name will be echoed. If `quiet` is a non-empty string,
# the only output will be in the case of an error, where the input `crate` is not a valid one.
_crate_short_name crate quiet="":
#!/usr/bin/env sh
set -eu
case {{crate}} in
astria-bridge-withdrawer) short_name=bridge-withdrawer ;;
astria-cli) short_name=cli ;;
astria-composer) short_name=composer ;;
astria-conductor) short_name=conductor ;;
astria-sequencer) short_name=sequencer ;;
astria-sequencer-relayer) short_name=sequencer-relayer ;;
*) echo "{{crate}} is not a supported binary" && exit 2
esac
[ -z {{quiet}} ] && echo $short_name || true
# Installs the astria rust cli from local codebase
install-cli:
Expand Down

0 comments on commit f875e46

Please sign in to comment.