Skip to content

Commit

Permalink
Merge branch 'feat/oracle' of github.com:astriaorg/astria into fraser…
Browse files Browse the repository at this point in the history
…/slinky
  • Loading branch information
noot committed Nov 6, 2024
2 parents 726c33f + 1450ca5 commit c9f3d18
Show file tree
Hide file tree
Showing 34 changed files with 1,045 additions and 99 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions charts/evm-bridge-withdrawer/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: 1.0.0
version: 1.0.1

# 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.0.0"
appVersion: "1.0.1"

maintainers:
- name: wafflesvonmaple
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-bridge-withdrawer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ images:
evmBridgeWithdrawer:
repo: ghcr.io/astriaorg/evm-bridge-withdrawer
pullPolicy: IfNotPresent
tag: 1.0.0
tag: 1.0.1
devTag: latest

config:
Expand Down
6 changes: 3 additions & 3 deletions charts/evm-stack/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ dependencies:
version: 0.1.2
- name: evm-bridge-withdrawer
repository: file://../evm-bridge-withdrawer
version: 1.0.0
version: 1.0.1
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 15.2.4
- name: blockscout-stack
repository: https://blockscout.github.io/helm-charts
version: 1.6.2
digest: sha256:c849edbcf6b12442d9ec8ffe2f21ceb4f50e58a65c2186340cae6df034f34eae
generated: "2024-10-27T10:49:54.580428-07:00"
digest: sha256:b0f9adad7d8a55f86ebd7b2e7aeb4f5b479b5b38a6c423ff013b9a5a57446f4d
generated: "2024-11-01T11:28:14.128143-07: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,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: 1.0.0
version: 1.0.1

dependencies:
- name: celestia-node
Expand All @@ -34,7 +34,7 @@ dependencies:
repository: "file://../evm-faucet"
condition: evm-faucet.enabled
- name: evm-bridge-withdrawer
version: 1.0.0
version: 1.0.1
repository: "file://../evm-bridge-withdrawer"
condition: evm-bridge-withdrawer.enabled
- name: postgresql
Expand Down
2 changes: 1 addition & 1 deletion charts/graph-node/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: graph-node
description: A Helm chart for Graph Node deployment
version: 0.1.0
version: 0.2.0
appVersion: "0.0.1"

maintainers:
Expand Down
23 changes: 13 additions & 10 deletions charts/graph-node/templates/volumes.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{/* We need to manually create a PersistentVolume when local. */}}
{{/* In prod, a PV will be created by the StorageClass' provisioner using dynamic provisioning feature. */}}
{{- if and .Values.ipfs.storage.enabled }}
{{- range $key, $value := .Values.storage.entities }}
{{- if $.Values.storage.local }}
{{- range $key, $value := .Values.ipfs.storage.entities }}
{{- if $.Values.ipfs.storage.local }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand Down Expand Up @@ -41,7 +41,7 @@ metadata:
"app.kubernetes.io/managed-by": {{ $.Release.Service | quote }}
"helm.sh/chart": {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}
spec:
{{- if $.Values.storage.local }}
{{- if $.Values.ipfs.storage.local }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}
{{- if $value.storageClassName }}
Expand All @@ -56,22 +56,25 @@ spec:
{{- end }}
{{- end }}
{{- if and .Values.postgres.storage.enabled }}
{{- range $key, $value := .Values.storage.entities }}
{{- if $.Values.storage.local }}
{{- range $key, $value := .Values.postgres.storage.entities }}
{{- if $.Values.postgres.storage.local }}
apiVersion: v1
kind: PersistentVolume
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
name: ipfs-pvc
spec:
capacity:
storage: {{ $value.size }}
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: {{ .Values.persistence.storageClass }}
accessModes:
- ReadWriteOnce
local:
path: {{ $value.path }}
resources:
requests:
storage: {{ .Values.ipfs.storage.size }}
nodeAffinity:
required:
nodeSelectorTerms:
Expand All @@ -93,7 +96,7 @@ metadata:
"app.kubernetes.io/managed-by": {{ $.Release.Service | quote }}
"helm.sh/chart": {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}
spec:
{{- if $.Values.storage.local }}
{{- if $.Values.postgres.storage.local }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- end }}
{{- if $value.storageClassName }}
Expand Down
24 changes: 24 additions & 0 deletions charts/sequencer/files/cometbft/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@
}
{{- if not .Values.global.dev }}
{{- else }}
"connect": {
"marketMap": {
"marketMap": {
"markets": {}
},
"params": {
"marketAuthorities": [],
"admin": "{{ .Values.genesis.marketAdminAddress }}"
}
},
"oracle": {
"currencyPairGenesis": [],
"nextId": "0"
}
}
{{- end}}
},
"chain_id": "{{ .Values.genesis.chainId }}",
Expand All @@ -160,7 +175,16 @@
},
"version": {
"app": "0"
},
{{- if not .Values.global.dev }}
"abci": {
"vote_extensions_enable_height": "0"
}
{{- else }}
"abci": {
"vote_extensions_enable_height": "1"
}
{{- end}}
},
"genesis_time": "{{ .Values.genesis.genesisTime }}",
"initial_height": "0",
Expand Down
3 changes: 3 additions & 0 deletions charts/sequencer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ sequencer:
mempool:
parked:
maxTxCount: 200
oracle:
clientTimeout: 1000
metrics:
enabled: false
otel:
Expand Down Expand Up @@ -276,6 +278,7 @@ ports:
sequencerGrpc: 8080
relayerRpc: 2450
sequencerMetrics: 9000
oracleGrpc: 8081

# ServiceMonitor configuration
serviceMonitor:
Expand Down
5 changes: 5 additions & 0 deletions crates/astria-bridge-contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Initial release.

### Fixed

- Fixed ICS20 withdrawal source when using channel with more than one
port/channel combo. [#1768](https://github.com/astriaorg/astria/pull/1768)
2 changes: 1 addition & 1 deletion crates/astria-bridge-contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ where
if let Some(ics20_asset_to_withdraw) = &ics20_asset_to_withdraw {
ics20_source_channel.replace(
ics20_asset_to_withdraw
.last_channel()
.leading_channel()
.ok_or(BuildError::ics20_asset_without_channel())?
.parse()
.map_err(BuildError::parse_ics20_asset_source_channel)?,
Expand Down
11 changes: 10 additions & 1 deletion crates/astria-bridge-withdrawer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.1] - 2024-11-01

### Fixed

- Set `batch_total_settled_value` metric to 0 when no withdrawals are settled [#1778](https://github.com/astriaorg/astria/pull/1768)
- Fixed ICS20 withdrawal source when using channel with more than one
port/channel combo.[#1768](https://github.com/astriaorg/astria/pull/1768)

## [1.0.0] - 2024-10-25

### Changed
Expand Down Expand Up @@ -93,7 +101,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release of EVM Withdrawer.

[unreleased]: https://github.com/astriaorg/astria/compare/bridge-withdrawer-v1.0.0...HEAD
[unreleased]: https://github.com/astriaorg/astria/compare/bridge-withdrawer-v1.0.1...HEAD
[1.0.1]: https://github.com/astriaorg/astria/compare/bridge-withdrawer-v1.0.0...bridge-withdrawer-v1.0.1
[1.0.0]: https://github.com/astriaorg/astria/compare/bridge-withdrawer-v1.0.0-rc.2...bridge-withdrawer-v1.0.0
[1.0.0-rc.2]: https://github.com/astriaorg/astria/compare/bridge-withdrawer-v1.0.0-rc.1...bridge-withdrawer-v1.0.0-rc.2
[1.0.0-rc.1]: https://github.com/astriaorg/astria/compare/bridge-withdrawer-v0.3.0...bridge-withdrawer-v1.0.0-rc.1
Expand Down
2 changes: 1 addition & 1 deletion crates/astria-bridge-withdrawer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astria-bridge-withdrawer"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
rust-version = "1.81.0"
license = "MIT OR Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Watcher {
.wrap_err("failed connecting to rollup after several retries; giving up")?;

let provider = Arc::new(provider);
let ics20_asset_to_withdraw = if rollup_asset_denom.last_channel().is_some() {
let ics20_asset_to_withdraw = if rollup_asset_denom.leading_channel().is_some() {
info!(
%rollup_asset_denom,
"configured rollup asset contains an ics20 channel; ics20 withdrawals will be emitted"
Expand Down Expand Up @@ -380,17 +380,16 @@ async fn get_and_forward_block_events(
if actions.is_empty() {
info!(
"no withdrawal actions found for block `{block_hash}` at rollup height \
`{rollup_height}; skipping"
`{rollup_height}"
);
} else {
submitter_handle
.send_batch(Batch {
actions,
rollup_height,
})
.await
.wrap_err("failed to send batched events; receiver dropped?")?;
}
submitter_handle
.send_batch(Batch {
actions,
rollup_height,
})
.await
.wrap_err("failed to send batched events; receiver dropped?")?;

Ok(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ impl Submitter {
metrics,
..
} = self;

if actions.is_empty() {
metrics.set_batch_total_settled_value(0);

return Ok(());
}

// get nonce and make unsigned transaction
let nonce = get_pending_nonce(
sequencer_grpc_client.clone(),
Expand Down
12 changes: 1 addition & 11 deletions crates/astria-bridge-withdrawer/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,8 @@ impl Metrics {
self.sequencer_submission_failure_count.increment(1);
}

#[expect(
clippy::cast_precision_loss,
reason = "metric with potential loss of precision, logging when it occurs"
)]
pub(crate) fn set_batch_total_settled_value(&self, value: u128) {
if value > u128::from(u32::MAX) {
tracing::warn!(
"{BATCH_TOTAL_SETTLED_VALUE} set with {value} which exceeds u32::MAX, precision \
loss in metric"
);
}
self.batch_total_settled_value.set(value as f64);
self.batch_total_settled_value.set(value);
}
}

Expand Down
5 changes: 5 additions & 0 deletions crates/astria-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fixed ICS20 withdrawal source when using channel with more than one
port/channel combo. [#1768](https://github.com/astriaorg/astria/pull/1768)

## [0.5.1] - 2024-10-23

### Added
Expand Down
6 changes: 6 additions & 0 deletions crates/astria-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Initial release.
- Added method `TracePrefixed::leading_channel` to read the left-most channel of
a trace prefixed ICS20 asset [#1768](https://github.com/astriaorg/astria/pull/1768)

### Removed

- Removed method `TracePrefixed::last_channel` [#1768](https://github.com/astriaorg/astria/pull/1768)
22 changes: 16 additions & 6 deletions crates/astria-core/src/primitive/v1/asset/denom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,23 @@ impl TracePrefixed {
self.trace.leading_channel() == Some(channel.as_ref())
}

/// Returns the ICS20 channel in the left-most position.
///
/// Returns `None` if the denom only contains a base and has no path segments.
/// A path segment is a pair `"<port>/<channel>"`.
///
/// # Examples
///
/// ```
/// use astria_core::primitive::v1::asset::denom::TracePrefixed;
/// let has_leading = "four/segments/of/a/denom".parse::<TracePrefixed>().unwrap();
/// let no_leading = "no_segments".parse::<TracePrefixed>().unwrap();
/// assert_eq!(has_leading.leading_channel(), Some("segments"));
/// assert_eq!(no_leading.leading_channel(), None);
/// ```
#[must_use]
pub fn last_channel(&self) -> Option<&str> {
self.trace.last_channel()
pub fn leading_channel(&self) -> Option<&str> {
self.trace.leading_channel()
}

pub fn pop_leading_port_and_channel(&mut self) -> Option<PortAndChannel> {
Expand Down Expand Up @@ -435,10 +449,6 @@ impl TraceSegments {
self.inner.pop_front()
}

fn last_channel(&self) -> Option<&str> {
self.inner.back().map(|segment| &*segment.channel)
}

fn is_empty(&self) -> bool {
self.inner.is_empty()
}
Expand Down
Loading

0 comments on commit c9f3d18

Please sign in to comment.