Skip to content

refactor(core, proto)!: define bridge memos in proto#1285

Merged
SuperFluffy merged 8 commits intomainfrom
superfluffy/memo-into-proto
Jul 25, 2024
Merged

refactor(core, proto)!: define bridge memos in proto#1285
SuperFluffy merged 8 commits intomainfrom
superfluffy/memo-into-proto

Conversation

@SuperFluffy
Copy link
Contributor

@SuperFluffy SuperFluffy commented Jul 22, 2024

Summary

Defines the bridge unlock, ics20 withdrawal, and ics20 deposit memos as protobuf.

Background

The various memos were read inside sequencer to inform the behaviour of the protocol, but were not defined in the canonical astria.protocol.v1alpha1 protobufs. This patch defines the memo types in a new astria.protocol.v1alpha1.memos so that there is a single source of truth for all protocol-relevant objects. The memos are still only ever serialiazed as plaintext JSON and not as protobuf.

Changes

  • Define the following types:
    • astria.protocol.v1alpha1.memos.BridgeUnlock
    • astria.protocol.v1alpha1.memos.Ics20WithdrawalFromRollup
    • astria.protocol.v1alpha1.memos.Ics20TransferDeposit
  • Remove the astria_core::bridge module
  • Update astria_bridge_contracts, astria_bridge_withdrawer, and astria_sequencer to operate in terms of these types
  • Update all memo fields containing bytes to be of type string so that the rollup-native formatting can be used (to make it easier to identify e.g. transactions and avoid the use of base64 for non-Astria byte slices)
  • Various field names have been updated to clarify that their source is the rollup (e.g. rollup_transaction_hash, rollup_return_address).

Testing

The changes in this code rely on smoke tests still working. Because the IBC tests require the latest (rust) astria-cli, the IBC tests were reworked.

Breaking Changelist

  • This is a protocl breaking change: the shape of the memo JSON objects has changed (object keys were renamed, the encoding of byte fields no longer requires base64).

Related Issues

Closes #1286

@github-actions github-actions bot added proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate labels Jul 22, 2024
@SuperFluffy SuperFluffy marked this pull request as ready for review July 22, 2024 15:58
@SuperFluffy SuperFluffy requested review from a team as code owners July 22, 2024 15:58
@SuperFluffy SuperFluffy force-pushed the superfluffy/memo-into-proto branch from 570dcf2 to 7efa2b1 Compare July 22, 2024 16:05
@SuperFluffy SuperFluffy force-pushed the superfluffy/memo-into-proto branch from 7efa2b1 to dcfe19a Compare July 22, 2024 16:09
@SuperFluffy SuperFluffy force-pushed the superfluffy/memo-into-proto branch from dcfe19a to 6ad69f5 Compare July 22, 2024 16:12
Copy link
Member

Choose a reason for hiding this comment

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

It seems as though the only breaking change here is changing the strings used for the memos. Would be good to have some discussion over this. I'm not tied to what they are, it's good to have them be designed more.

Technically it is better to have as concise as necessary field names here, as each charachter is bytes we must include in txs and thus blocks, and we should expect briding txs to be some of our absolute most common txs.

Copy link
Contributor Author

@SuperFluffy SuperFluffy Jul 25, 2024

Choose a reason for hiding this comment

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

I have changed the format of the hash and address types: before, the rust types were of type [u8; N] and serialized as base64, now they are opaque string so that the rollup can decide to write them in its favorite format.

No hard opinions on the names. I think this would be better addressed by compression of the data before being put into blocks, but maybe that would require too much of a lift. :-/

Copy link
Member

Choose a reason for hiding this comment

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

I think a long term option would be that we could upgrade to accept json OR base64 formatted pb wire format through the memo. Less human readable, would offer the wire format elimination of names space savings.

Reviewing names, I think these do offer enhanced clarity.

@SuperFluffy SuperFluffy force-pushed the superfluffy/memo-into-proto branch from 6ad69f5 to ba836bd Compare July 25, 2024 13:50
@SuperFluffy SuperFluffy requested review from a team as code owners July 25, 2024 13:50
@SuperFluffy SuperFluffy requested a review from steezeburger July 25, 2024 13:50
@github-actions github-actions bot added ci issues that are related to ci and github workflows cd labels Jul 25, 2024
- name: Install astria cli (rust)
run: just install-cli
- name: Fetch and install celestia-appd
run: just get-celestia-appd v1.9.0 Linux x86_64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be avoided if we make celestia-local into a stateful set. We could then kubectl execute from inside the celestia-local container, making this step unnecessary.

Copy link
Member

Choose a reason for hiding this comment

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

I'll note that celestia-local being a statefulset is technically correct and I believe basically a oneliner + file rename for consistency.

Some concern that this creates room for key collision running locally. I think we can refactor the smoke-test in general after merge though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this indeed has that issue, which running directly inside a stateful set wouldn't have. Followup sounds good. I will create an issue.

just ibc-test deploy $TAG
- name: Run IBC ICS20 Transfer test
timeout-minutes: 3
run: just ibc-test run ./celestia ./celestia-appd
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar to above: the arguments are required because we need to provide a celestia "home" directory, and the path to the celestia-appd executable. It would be neater if we could run straight from the container running celestia-appd.

Copy link
Member

@joroshiba joroshiba left a comment

Choose a reason for hiding this comment

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

Approved, I think in general the smoke tests could use cleanup but that can be follow up.

Comment on lines +230 to +237
init-ibc-bridge privateKey asset feeAsset rollupName=defaultRollupName:
astria-cli sequencer init-bridge-account \
--rollup-name {{ rollupName }} \
--private-key {{ privateKey }} \
--sequencer.chain-id {{ sequencer_chain_id }} \
--sequencer-url {{ sequencer_rpc_url }} \
--fee-asset {{ feeAsset }} \
--asset {{ asset }}
Copy link
Member

Choose a reason for hiding this comment

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

nit: duplication with above init-rollup-bridge code. this can be follow up cleanup though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a partial duplication. feeAsset and asset are hardcoded in init-rollup-bridge, and there is an additional lock command to lock to the rollup. Could be refactored.

# operatingSystem is Linux or Darwin
# machineHardwareName is arm64 or x86_64
celestia_default_appd_dst := "."
get-celestia-appd version operatingSystem machineHardwareName dst=celestia_default_appd_dst:
Copy link
Member

Choose a reason for hiding this comment

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

we have install-cli should this be install-celestia-appd?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because we don't install it. cargo install foo puts foo in a well known spot (~/.cargo/bin) that is expexted to be in PATH. I don't really know where to put this binary because I don't have knowledge of the users PATH.

Either way, we can remove this entirely when moving to a stateful set.

- name: Install astria cli (rust)
run: just install-cli
- name: Fetch and install celestia-appd
run: just get-celestia-appd v1.9.0 Linux x86_64
Copy link
Member

Choose a reason for hiding this comment

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

I'll note that celestia-local being a statefulset is technically correct and I believe basically a oneliner + file rename for consistency.

Some concern that this creates room for key collision running locally. I think we can refactor the smoke-test in general after merge though.

Copy link
Member

Choose a reason for hiding this comment

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

I think a long term option would be that we could upgrade to accept json OR base64 formatted pb wire format through the memo. Less human readable, would offer the wire format elimination of names space savings.

Reviewing names, I think these do offer enhanced clarity.

Co-authored-by: Jordan Oroshiba <jordan@astria.org>
@SuperFluffy SuperFluffy enabled auto-merge July 25, 2024 18:42
@SuperFluffy SuperFluffy added this pull request to the merge queue Jul 25, 2024
Merged via the queue into main with commit 892e408 Jul 25, 2024
@SuperFluffy SuperFluffy deleted the superfluffy/memo-into-proto branch July 25, 2024 18:54
steezeburger added a commit that referenced this pull request Jul 29, 2024
* main:
  release: cut bridge withdrawer release (#1303)
  release: version cuts for dusk-9 (#1299)
  chore(core): remove ed25519_consensus from public API (#1277)
  chore: remove spurious entry in gitignore (#1276)
  chore(chart): Update EVM-Rollup Geth devTag (#1300)
  fix(proto)!: Change execution API to use primitive RollupId (#1291)
  refactor(core, proto)!: define bridge memos in proto (#1285)
  chore(sequencer-relayer)!: minimize resubmissions to Celestia (#1234)
github-merge-queue bot pushed a commit that referenced this pull request Aug 4, 2024
…1302)

## Summary
Updates the `charts/celestia-local` to spin up `celestia-appd` in a
stateful set. Executes the ics20 transfer inside the celestia-app
container inside the set.

## Background
#1285 updates the ibc ics20
transfer test to require `celestia-appd` and an initialized celestia
keystore to be present on the machine running the test. This is
undesirable because it pollutes the host environment and creates
potential for collisions. Turning `celestia-local` from a kubernetes
deployment to a stateful set allows executing the ics20 transfer from
inside the container.

## Changes
- Rename `charts/celestia-local/templates/deployment.yaml ->
charts/celestia-local/templates/statefulsets.yaml`
- Changes `kind: Deployment -> kind: StatefulSet` in that file
- Update recipes in `charts/deploy.just` to use `kubectl rollout status`
instead of `kubectl wait` (the latter does not seem to work with
stateful sets)
- Use `kubectl exec` against the celestia-app container in the stateful
set to initialize the transfer instead of a locally present
`celestia-appd`

## Testing
This is an update to the ibc ics20 smoke test flow. The test still
passes with the expected result.

## Related Issues
Closes #1296
Closes #1295
ethanoroshiba pushed a commit that referenced this pull request Aug 13, 2024
…1302)

## Summary
Updates the `charts/celestia-local` to spin up `celestia-appd` in a
stateful set. Executes the ics20 transfer inside the celestia-app
container inside the set.

## Background
#1285 updates the ibc ics20
transfer test to require `celestia-appd` and an initialized celestia
keystore to be present on the machine running the test. This is
undesirable because it pollutes the host environment and creates
potential for collisions. Turning `celestia-local` from a kubernetes
deployment to a stateful set allows executing the ics20 transfer from
inside the container.

## Changes
- Rename `charts/celestia-local/templates/deployment.yaml ->
charts/celestia-local/templates/statefulsets.yaml`
- Changes `kind: Deployment -> kind: StatefulSet` in that file
- Update recipes in `charts/deploy.just` to use `kubectl rollout status`
instead of `kubectl wait` (the latter does not seem to work with
stateful sets)
- Use `kubectl exec` against the celestia-app container in the stateful
set to initialize the transfer instead of a locally present
`celestia-appd`

## Testing
This is an update to the ibc ics20 smoke test flow. The test still
passes with the expected result.

## Related Issues
Closes #1296
Closes #1295
ethanoroshiba pushed a commit that referenced this pull request Aug 14, 2024
…1302)

## Summary
Updates the `charts/celestia-local` to spin up `celestia-appd` in a
stateful set. Executes the ics20 transfer inside the celestia-app
container inside the set.

## Background
#1285 updates the ibc ics20
transfer test to require `celestia-appd` and an initialized celestia
keystore to be present on the machine running the test. This is
undesirable because it pollutes the host environment and creates
potential for collisions. Turning `celestia-local` from a kubernetes
deployment to a stateful set allows executing the ics20 transfer from
inside the container.

## Changes
- Rename `charts/celestia-local/templates/deployment.yaml ->
charts/celestia-local/templates/statefulsets.yaml`
- Changes `kind: Deployment -> kind: StatefulSet` in that file
- Update recipes in `charts/deploy.just` to use `kubectl rollout status`
instead of `kubectl wait` (the latter does not seem to work with
stateful sets)
- Use `kubectl exec` against the celestia-app container in the stateful
set to initialize the transfer instead of a locally present
`celestia-appd`

## Testing
This is an update to the ibc ics20 smoke test flow. The test still
passes with the expected result.

## Related Issues
Closes #1296
Closes #1295
github-merge-queue bot pushed a commit that referenced this pull request Aug 22, 2024
## Summary
Defines `astria.protocol.genesis.v1alpha1.GenesisAppState`, replacing
the Rust-as-JSON definition.

## Background
All protocol relevant Astria types are supposed to be defined in
Astria's protobuf spec. With
#1285 having redefined the memos
as protobuf message, this patch migrates the last type to protobuf spec.

## Changes
- Define `astria.protocol.genesis.v1alpha1.GenesisAppState` and related
protobuf messages
- Remove the `astria-core::sequencer::GenesisState` module
- Update Sequencer in terms of the protobuf type
- Update all charts and snapshots (especially the genesis template)

## Testing
All tests have been updated to use the new types, including snapshot
tests. The genesis state is only read at `init-chain` and does not
affect the evaluation of the state machine. Hence no tests should change
as long as the same data is passed in (which is reflected by
`tests-breaking-changes` leading to the same hash).

## Breaking Changelist
This is a breaking change because an old sequencer would not understand
a new (json-formatted) genesis app state and vise versa.

## Related issues
Closes #1347
sgranfield4403-3 added a commit to sgranfield4403-3/astria that referenced this pull request Oct 2, 2025
…(#1302)

## Summary
Updates the `charts/celestia-local` to spin up `celestia-appd` in a
stateful set. Executes the ics20 transfer inside the celestia-app
container inside the set.

## Background
astriaorg/astria#1285 updates the ibc ics20
transfer test to require `celestia-appd` and an initialized celestia
keystore to be present on the machine running the test. This is
undesirable because it pollutes the host environment and creates
potential for collisions. Turning `celestia-local` from a kubernetes
deployment to a stateful set allows executing the ics20 transfer from
inside the container.

## Changes
- Rename `charts/celestia-local/templates/deployment.yaml ->
charts/celestia-local/templates/statefulsets.yaml`
- Changes `kind: Deployment -> kind: StatefulSet` in that file
- Update recipes in `charts/deploy.just` to use `kubectl rollout status`
instead of `kubectl wait` (the latter does not seem to work with
stateful sets)
- Use `kubectl exec` against the celestia-app container in the stateful
set to initialize the transfer instead of a locally present
`celestia-appd`

## Testing
This is an update to the ibc ics20 smoke test flow. The test still
passes with the expected result.

## Related Issues
Closes #1296
Closes #1295
sgranfield4403-3 added a commit to sgranfield4403-3/astria that referenced this pull request Oct 2, 2025
## Summary
Defines `astria.protocol.genesis.v1alpha1.GenesisAppState`, replacing
the Rust-as-JSON definition.

## Background
All protocol relevant Astria types are supposed to be defined in
Astria's protobuf spec. With
astriaorg/astria#1285 having redefined the memos
as protobuf message, this patch migrates the last type to protobuf spec.

## Changes
- Define `astria.protocol.genesis.v1alpha1.GenesisAppState` and related
protobuf messages
- Remove the `astria-core::sequencer::GenesisState` module
- Update Sequencer in terms of the protobuf type
- Update all charts and snapshots (especially the genesis template)

## Testing
All tests have been updated to use the new types, including snapshot
tests. The genesis state is only read at `init-chain` and does not
affect the evaluation of the state machine. Hence no tests should change
as long as the same data is passed in (which is reflected by
`tests-breaking-changes` leading to the same hash).

## Breaking Changelist
This is a breaking change because an old sequencer would not understand
a new (json-formatted) genesis app state and vise versa.

## Related issues
Closes astriaorg/astria#1347
AngieD101 added a commit to AngieD101/astria that referenced this pull request Oct 10, 2025
…(#1302)

## Summary
Updates the `charts/celestia-local` to spin up `celestia-appd` in a
stateful set. Executes the ics20 transfer inside the celestia-app
container inside the set.

## Background
astriaorg/astria#1285 updates the ibc ics20
transfer test to require `celestia-appd` and an initialized celestia
keystore to be present on the machine running the test. This is
undesirable because it pollutes the host environment and creates
potential for collisions. Turning `celestia-local` from a kubernetes
deployment to a stateful set allows executing the ics20 transfer from
inside the container.

## Changes
- Rename `charts/celestia-local/templates/deployment.yaml ->
charts/celestia-local/templates/statefulsets.yaml`
- Changes `kind: Deployment -> kind: StatefulSet` in that file
- Update recipes in `charts/deploy.just` to use `kubectl rollout status`
instead of `kubectl wait` (the latter does not seem to work with
stateful sets)
- Use `kubectl exec` against the celestia-app container in the stateful
set to initialize the transfer instead of a locally present
`celestia-appd`

## Testing
This is an update to the ibc ics20 smoke test flow. The test still
passes with the expected result.

## Related Issues
Closes #1296
Closes #1295
AngieD101 added a commit to AngieD101/astria that referenced this pull request Oct 10, 2025
## Summary
Defines `astria.protocol.genesis.v1alpha1.GenesisAppState`, replacing
the Rust-as-JSON definition.

## Background
All protocol relevant Astria types are supposed to be defined in
Astria's protobuf spec. With
astriaorg/astria#1285 having redefined the memos
as protobuf message, this patch migrates the last type to protobuf spec.

## Changes
- Define `astria.protocol.genesis.v1alpha1.GenesisAppState` and related
protobuf messages
- Remove the `astria-core::sequencer::GenesisState` module
- Update Sequencer in terms of the protobuf type
- Update all charts and snapshots (especially the genesis template)

## Testing
All tests have been updated to use the new types, including snapshot
tests. The genesis state is only read at `init-chain` and does not
affect the evaluation of the state machine. Hence no tests should change
as long as the same data is passed in (which is reflected by
`tests-breaking-changes` leading to the same hash).

## Breaking Changelist
This is a breaking change because an old sequencer would not understand
a new (json-formatted) genesis app state and vise versa.

## Related issues
Closes astriaorg/astria#1347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cd ci issues that are related to ci and github workflows proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move withdrawal memos into the protocol protobuf spec

2 participants