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

refactor(bridge): favor composition over inheritance #35

Closed
wants to merge 1 commit into from

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Feb 1, 2022

"BaseForeignGateway is an IL1Bridge" replaced by "BaseForeignGateway has an IL1Bridge".

In particular:

  • "arbitrum.EthereumGateway has an ArbL1Bridge"
  • "xdai.EthereumGateway has a xDaiL1Bridge"

Similarly for BaseHomeGateway.

The main differences:

  • Access control is required in the implementation of ILxBridge.sendCrossDomainMessage()
  • Slightly more gas, mostly relevant for Mainnet. In practice this bridge is not used during normal operations later (challenges only), and the fast bridge version will be called for a batch of messages, so the gas cost is incurred for a batch, not per message.

@jaybuidl
Copy link
Member Author

jaybuidl commented Feb 3, 2022

This decision will have mostly an impact on the long term but not so much at this stage. More feedback from other team members would be helpful as there are merits to both approaches.

On hold for now.

@jaybuidl
Copy link
Member Author

jaybuidl commented Feb 8, 2022

Can be closed now, it has been addressed as part of #36

@jaybuidl jaybuidl closed this Feb 8, 2022
@jaybuidl jaybuidl deleted the feature/gateway-has-a-bridge branch February 8, 2022 00:41
@jaybuidl jaybuidl restored the feature/gateway-has-a-bridge branch November 24, 2022 02:59
@jaybuidl jaybuidl deleted the feature/gateway-has-a-bridge branch November 24, 2022 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inheritance over composition for BaseXGateway-ILxBridge relationship
1 participant