Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): add cmd to collect withdrawal events and submit as actions #1261

Merged
merged 14 commits into from
Jul 13, 2024

Conversation

SuperFluffy
Copy link
Member

@SuperFluffy SuperFluffy commented Jul 10, 2024

Summary

Adds bridge collect-withdrawals and bridge submit-withdrawals subcommands to astria-cli.

Background

The worker service astria-bridge-withdrawer is a closed system that collects withdrawal event from the rollup and submits them to the sequencer in a closed loop. But it can be desirable to inspect the withdrawal events generated by the bridge contracts, and then submit them manually. This functionality is now provided by astria-cli.

Changes

  • Add subcommands bridge collect-withdrawal-s to astria-cli, which has two different modes of operation, depending on whether --to-rollup-height is set:
    • if set, it fetches all blocks between --from-rollup-height and --to-rollup-height (inclusive), converts them to seuquencer actions, and then writes them to a file.
    • if not set, it fetches blocks from --from-rollup-height until SIGINT (Ctrl-C) is received. After the signal, the converted actions are written to a file.

Testing

  • Added run-smoke-cli in charts/deploy.just (@joroshiba)
  • Added a smoke-cli: in .github/workflows/docker-build.yaml (@joroshiba)

Base automatically changed from superfluffy/serde-for-all-protobuf to main July 11, 2024 05:56
@github-actions github-actions bot added proto pertaining to the Astria Protobuf spec sequencer pertaining to the astria-sequencer crate labels Jul 11, 2024
@SuperFluffy SuperFluffy marked this pull request as ready for review July 11, 2024 11:36
@SuperFluffy SuperFluffy requested a review from a team as a code owner July 11, 2024 11:36
@SuperFluffy SuperFluffy requested a review from noot July 11, 2024 11:36
@SuperFluffy SuperFluffy requested a review from noot July 12, 2024 13:33
## Summary
Adds a subcommand to submit previously collected withdrawal events.

## Background
#1261 provides a subcommand to
listen to and collect withdrawal events that come form a rollup's astria
contracts. This patch now provides the ability to also submit the
events.

## Changes
- Added a `bridge submit-withdrawals` subcommand to `astria-cli`
- Renamed `bridge collect-withdrawal-events` to `bridge
collect-withdrawals`
- Adjusted the object written and read to be a json object
`rollup_height -> [actions]`.

## Testing
TBD
@SuperFluffy SuperFluffy changed the title feat(cli): add bridge cmd to collect withdrawal events feat(cli): add cmd to collect withdrawal events and submit as actions Jul 13, 2024
@SuperFluffy SuperFluffy requested a review from a team as a code owner July 13, 2024 14:53
@github-actions github-actions bot added the ci issues that are related to ci and github workflows label Jul 13, 2024

clap = { workspace = true, features = ["derive", "env"] }
ethers = { workspace = true, features = ["ws"] }
Copy link
Member

Choose a reason for hiding this comment

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

hello darkness my old friend

@github-actions github-actions bot added the cd label Jul 13, 2024
@SuperFluffy SuperFluffy added this pull request to the merge queue Jul 13, 2024
Merged via the queue into main with commit 1555c03 Jul 13, 2024
41 checks passed
@SuperFluffy SuperFluffy deleted the superfluffy/bridge-sub-cmd branch July 13, 2024 15:31
steezeburger added a commit that referenced this pull request Jul 15, 2024
* main:
  feat(cli): add cmd to collect withdrawal events and submit as actions (#1261)
  fix(core, bridge, sequencer)!: dismabiguate return addresses (#1266)
  fix(withdrawer): support withdrawer address that differs from bridge address   (#1262)
  (core, sequencer)!: generate serde traits impls for all protocol protobufs (#1260)
  fix(charts): add resources for sequencer/cometbft (#1254)
  chore(sequencer)!: add metrics (#1248)
  fix(sequencer-utils): fixes issue in `parse_blob` tests (#1243)
  feat(core, proto)!: make bridge unlock memo string (#1244)
  fix(conductor): don't panic during panic (#1252)
  feat(core)!: lowerCamelCase for protobuf json mapping (#1250)
  refactor(bridge-withdrawer)!: refactor startup to a separate subtask and remove balance check from startup (#1190)
  fix: rollup archive node configurations (#1249)
  refactor(core, bridge-withdrawer)!: move bridge-unlock memo to core (#1245)
  fix(sequencer)!: store native asset ibc->trace mapping in init_chain (#1242)
steezeburger added a commit that referenced this pull request Jul 19, 2024
* main: (24 commits)
  chore: update `bytes` and `ics23` crates (#1279)
  fix(sequencer): improve and fix instrumentation (#1255)
  feature(charts): hermes chart fixes, bech32 updates, ibc bridge test (#1130)
  chore(cli): remove unused rollup cli code (#1275)
  chore(test): use a temporary file to not pollute the workspace (#1269)
  chore(sequencer): add mempool benchmarks (#1238)
  fix(bridge-withdrawer)!: fix nonce handling (#1215)
  feat(cli, bridge-withdrawer)!: share code between cli and service (#1270)
  feat(cli): add cmd to collect withdrawal events and submit as actions (#1261)
  fix(core, bridge, sequencer)!: dismabiguate return addresses (#1266)
  fix(withdrawer): support withdrawer address that differs from bridge address   (#1262)
  (core, sequencer)!: generate serde traits impls for all protocol protobufs (#1260)
  fix(charts): add resources for sequencer/cometbft (#1254)
  chore(sequencer)!: add metrics (#1248)
  fix(sequencer-utils): fixes issue in `parse_blob` tests (#1243)
  feat(core, proto)!: make bridge unlock memo string (#1244)
  fix(conductor): don't panic during panic (#1252)
  feat(core)!: lowerCamelCase for protobuf json mapping (#1250)
  refactor(bridge-withdrawer)!: refactor startup to a separate subtask and remove balance check from startup (#1190)
  fix: rollup archive node configurations (#1249)
  ...
bharath-123 pushed a commit that referenced this pull request Jul 25, 2024
…#1261)

## Summary
Adds `bridge collect-withdrawals` and `bridge submit-withdrawals`
subcommands to `astria-cli`.

## Background
The worker service `astria-bridge-withdrawer` is a closed system that
collects withdrawal event from the rollup and submits them to the
sequencer in a closed loop. But it can be desirable to inspect the
withdrawal events generated by the bridge contracts, and then submit
them manually. This functionality is now provided by `astria-cli`.

## Changes
- Add subcommands `bridge collect-withdrawal-s` to `astria-cli`, which
has two different modes of operation, depending on whether
`--to-rollup-height` is set:
- if set, it fetches all blocks between `--from-rollup-height` and
`--to-rollup-height` (inclusive), converts them to seuquencer actions,
and then writes them to a file.
- if not set, it fetches blocks from `--from-rollup-height` until SIGINT
(Ctrl-C) is received. After the signal, the converted actions are
written to a file.

## Testing
- Added `run-smoke-cli` in `charts/deploy.just` (@joroshiba)
- Added a `smoke-cli:` in `.github/workflows/docker-build.yaml`
(@joroshiba)

---------

Co-authored-by: Jordan Oroshiba <jordan@astria.org>
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.

3 participants