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

Induce data availability into contract #41

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Induce data availability into contract #41

wants to merge 14 commits into from

Conversation

noel2004
Copy link
Member

This PR make new contract work with data availability. The encoded tx data would be an argument when submitting block and being verified in the contract. As the result, the signature of submitBlock method has been revised.

For the new implement of submitBlock, some view function is added to facilitate debugging and checking everything is ready without wasting of gas fee.

Note current the original submitBlock method is still being kept in the contract under the name submitBlockLegacy in case we still need it for some legacy task or compare the gas usage. This need to be removed before the contract is officially released.

@noel2004 noel2004 changed the title Induce data availability into contract WIP: Induce data availability into contract Nov 29, 2021
@noel2004
Copy link
Member Author

noel2004 commented Dec 3, 2021

Almost done for contract with data availability and handling L1 op (current only depositing and registering),
work left:

  • Templatize the parameters in Operations
  • When adding token, method should also specify precise of the token
  • Update the dispatched amount in deposit event (should be scaled to the real amount used in exchange and rollup)

@noel2004
Copy link
Member Author

noel2004 commented Dec 3, 2021

For encoding the priority op of registry user, the gas usage increase to ~330k in registryUser method (before it cost ~90k)

}
}

function shiftAndReverseBits16(uint16 val, uint8 offset)
Copy link
Member

Choose a reason for hiding this comment

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

can we combine shiftAndReverseBits16, shiftAndReverseBits32, shiftAndReverseBits64, shiftAndReverseBits128?

Copy link
Member Author

Choose a reason for hiding this comment

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

tried but failed. If we defined both foo(uint16) and foo(uint32), the calling of foo seems to be considered as ambiguous even you have specified the type of argument explicitly.

@noel2004
Copy link
Member Author

Finally all issues have been fixed and contracts now complete work with priority L1 ops. A script for depositing on L1 has also be induced

@noel2004 noel2004 changed the title WIP: Induce data availability into contract Induce data availability into contract Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants