Skip to content

refactor(bridge-withdrawer): move generated contract bindings to crate#1237

Merged
SuperFluffy merged 3 commits intomainfrom
superfluffy/generate-contract-code
Jul 8, 2024
Merged

refactor(bridge-withdrawer): move generated contract bindings to crate#1237
SuperFluffy merged 3 commits intomainfrom
superfluffy/generate-contract-code

Conversation

@SuperFluffy
Copy link
Contributor

Summary

Moves the generated Rust bindings for Astria's bridge smart contracts to a free standing crate.

Background

Breaking out the bindings outside the astria-bridge-withdrawer binary crate is needed to share code with a CLI tool to manually initiate withdrawals.

This patch also uses the opportunity and makes the process of re-generating bindings (and committing them to the repo) more similar to how protobuf-bindings are generated: tools/solidity-compiler updates the git submodule in astria-bridge-contracts and then regenerates all bindings. The bindings are placed in astria-bridge-contracts/src/generated and commited to the repository.

Changes

  • Create crates/astria-bridge-contracts crate and move the submodule of the same name there
  • Create tools/solidity-compiler tool and use it to generate rust bindings for the bridge contracts
  • Update astria-bridge-withdrawer to use astria-bridge-contracts as a dependency
  • Add a job solidity-contracts-compiled to ensure that the contracts are up-to-date.

Testing

Apart from some types being renamed, nothing has changed.

@github-actions github-actions bot added the ci issues that are related to ci and github workflows label Jul 4, 2024
@SuperFluffy SuperFluffy force-pushed the superfluffy/generate-contract-code branch 3 times, most recently from 6ad4f01 to 1e76af3 Compare July 4, 2024 20:10
@SuperFluffy SuperFluffy force-pushed the superfluffy/generate-contract-code branch from 1e76af3 to 986947a Compare July 4, 2024 20:17
@SuperFluffy SuperFluffy marked this pull request as ready for review July 4, 2024 20:17
@SuperFluffy SuperFluffy requested review from a team, joroshiba and noot as code owners July 4, 2024 20:17
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 for infra

@SuperFluffy SuperFluffy enabled auto-merge July 8, 2024 09:46
@SuperFluffy SuperFluffy added this pull request to the merge queue Jul 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 8, 2024
@SuperFluffy SuperFluffy added this pull request to the merge queue Jul 8, 2024
Merged via the queue into main with commit c9e4898 Jul 8, 2024
@SuperFluffy SuperFluffy deleted the superfluffy/generate-contract-code branch July 8, 2024 10:12
steezeburger added a commit that referenced this pull request Jul 11, 2024
* main: (27 commits)
  refactor(sequencer): fix prepare proposal metrics (#1211)
  refactor(bridge-withdrawer): move generated contract bindings to crate (#1237)
  fix(sequencer) fix wrong metric and remove unused metric (#1240)
  feat(sequencer): implement transaction fee query (#1196)
  chore(cli)!: remove unmaintained rollup subcommand (#1235)
  release(sequencer): 0.14.1 patch release (#1233)
  feat(sequencer-utils): generate example genesis state (#1224)
  feat(sequencer): implement abci query for bridge account info (#1189)
  feat(charts): bridge-withdrawer, smoke test, various chart improvements (#1141)
  chore(charts): update for new geth update (#1226)
  chore(chart)!: dusk-8 chart version updates (#1223)
  release(conductor): fix conductor release version (#1222)
  release: dusk-8 versions (#1219)
  fix(core): revert `From` ed25519_consensus types for crypto mod (#1220)
  Refactor(chart, sequencer): restructure sequencer chart, adjust configs (#1193)
  refactor(withdrawer): read from block subscription stream and get events on each block (#1207)
  feat(core): implement with verification key for address builder and crypto improvements (#1218)
  feat(proto, sequencer)!: use full IBC ICS20 denoms instead of IDs (#1209)
  chore(chart): update evm chart for new prefix field (#1214)
  chore: bump penumbra deps (#1216)
  ...
bharath-123 pushed a commit that referenced this pull request Jul 25, 2024
#1237)

## Summary
Moves the generated Rust bindings for Astria's bridge smart contracts to
a free standing crate.

## Background
Breaking out the bindings outside the `astria-bridge-withdrawer` binary
crate is needed to share code with a CLI tool to manually initiate
withdrawals.

This patch also uses the opportunity and makes the process of
re-generating bindings (and committing them to the repo) more similar to
how protobuf-bindings are generated: `tools/solidity-compiler` updates
the git submodule in `astria-bridge-contracts` and then regenerates all
bindings. The bindings are placed in
`astria-bridge-contracts/src/generated` and commited to the repository.

## Changes
- Create `crates/astria-bridge-contracts` crate and move the submodule
of the same name there
- Create `tools/solidity-compiler` tool and use it to generate rust
bindings for the bridge contracts
- Update `astria-bridge-withdrawer` to use `astria-bridge-contracts` as
a dependency
- Add a job `solidity-contracts-compiled` to ensure that the contracts
are up-to-date.

## Testing
Apart from some types being renamed, nothing has changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci issues that are related to ci and github workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants