Skip to content

Commit

Permalink
feat(proto, core, sequencer)!: add traceability to rollup deposits (#…
Browse files Browse the repository at this point in the history
…1410)

## Summary
Added `id_of_source_transaction` and `position_in_source_transaction` to
`Deposit`.

## Background
Previous deposit events had no information about the deposit source, so
rollups could not trace if their deposits had landed without checking
the balance. Additionally, this could result in deposit txs having the
same hash in the EVM.

## Changes
- Created primitive proto type `TransactionId` for identifying source
transaction in deposits.
- Added `id_of_source_transaction` and `position_in_source_transaction`
to `Deposit`.
- Included tx id in the ephemeral state via `current_source()` so that
it can be accessed by actions.
- Added accessors/mutators for deposit index to `StateReadExt` and
`StateWriteExt` traits in `transaction`.
- Updated `bridge_lock` and `ics20_transfer` actions to populate
`Deposit` events with transaction id and index based on the state.

## Testing
Added test to ensure `position_in_source_transaction` is incremented
correctly.

## Breaking Changelist
- App hash changed because of increasing block fees due to longer length
of `Deposit`.
- Changed SequencerBlock API `Deposit` event, having two new mandatory
fields `source_transaction_id` and `source_action_index`.
`source_transaction_id` uses a new primitive proto type `TransactionId`.

## Related Issues
with astriaorg/astria-geth#42, closes #1402

---------

Co-authored-by: Jordan Oroshiba <[email protected]>
Co-authored-by: Fraser Hutchison <[email protected]>
Co-authored-by: jesse snyder <[email protected]>
  • Loading branch information
4 people committed Sep 11, 2024
1 parent 64b9106 commit f543222
Show file tree
Hide file tree
Showing 42 changed files with 640 additions and 209 deletions.
2 changes: 1 addition & 1 deletion charts/evm-rollup/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.26.2
version: 0.27.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
Expand Down
2 changes: 1 addition & 1 deletion charts/evm-rollup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ images:
geth:
repo: ghcr.io/astriaorg/astria-geth
tag: 0.14.0
devTag: latest
devTag: pr-42 # update to latest once geth changes(https://github.com/astriaorg/astria-geth/pull/42) merged
overrideTag: ""
conductor:
repo: ghcr.io/astriaorg/conductor
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 @@ -4,7 +4,7 @@ dependencies:
version: 0.3.6
- name: evm-rollup
repository: file://../evm-rollup
version: 0.26.2
version: 0.27.0
- name: composer
repository: file://../composer
version: 0.1.2
Expand All @@ -20,5 +20,5 @@ dependencies:
- name: blockscout-stack
repository: https://blockscout.github.io/helm-charts
version: 1.6.2
digest: sha256:d9eba8331d5b2adadb63118a62342f469a30387a7edb290047ff1bcd35d5d4f8
generated: "2024-09-05T15:18:03.739771-04:00"
digest: sha256:e2209c2b6aa17c3163bcbd32eea4bdbb0df9b108ff353a0020ff951186bb1350
generated: "2024-09-04T11:23:10.710044-05: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,15 +15,15 @@ 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.4.3
version: 0.5.0

dependencies:
- name: celestia-node
version: 0.3.6
repository: "file://../celestia-node"
condition: celestia-node.enabled
- name: evm-rollup
version: 0.26.2
version: 0.27.0
repository: "file://../evm-rollup"
- name: composer
version: 0.1.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ fn rollup_height_from_signed_transaction(
.expect("action is already checked to be either BridgeUnlock or Ics20Withdrawal");

info!(
last_batch.tx_hash = %telemetry::display::hex(&signed_transaction.sha256_of_proto_encoding()),
last_batch.transaction_id = %signed_transaction.id(),
last_batch.rollup_height = last_batch_rollup_height,
"extracted rollup height from last batch of withdrawals",
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl Submitter {

// sign transaction
let signed = unsigned.into_signed(signer.signing_key());
debug!(tx_hash = %telemetry::display::hex(&signed.sha256_of_proto_encoding()), "signed transaction");
debug!(transaction_id = %&signed.id(), "signed transaction");

// submit transaction and handle response
let (check_tx, tx_response) = submit_tx(
Expand Down Expand Up @@ -225,7 +225,7 @@ fn report_exit(reason: eyre::Result<&str>) {
skip_all,
fields(
nonce = tx.nonce(),
transaction.hash = %telemetry::display::hex(&tx.sha256_of_proto_encoding()),
transaction.id = %tx.id(),
),
err
)]
Expand Down
4 changes: 2 additions & 2 deletions crates/astria-composer/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ impl Future for SubmitFut {
info!(
nonce.actual = *this.nonce,
bundle = %telemetry::display::json(&SizedBundleReport(this.bundle)),
transaction.hash = %telemetry::display::hex(&tx.sha256_of_proto_encoding()),
transaction.id = %tx.id(),
"submitting transaction to sequencer",
);
SubmitState::WaitingForSend {
Expand Down Expand Up @@ -767,7 +767,7 @@ impl Future for SubmitFut {
info!(
nonce.resubmission = *this.nonce,
bundle = %telemetry::display::json(&SizedBundleReport(this.bundle)),
transaction.hash = %telemetry::display::hex(&tx.sha256_of_proto_encoding()),
transaction.id = %tx.id(),
"resubmitting transaction to sequencer with new nonce",
);
SubmitState::WaitingForSend {
Expand Down
18 changes: 18 additions & 0 deletions crates/astria-core/src/generated/astria.primitive.v1.rs

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

91 changes: 91 additions & 0 deletions crates/astria-core/src/generated/astria.primitive.v1.serde.rs

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

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

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

Loading

0 comments on commit f543222

Please sign in to comment.