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: network contracts #382

Closed
wants to merge 2 commits into from
Closed

feat: network contracts #382

wants to merge 2 commits into from

Conversation

mattstam
Copy link
Contributor

@mattstam mattstam commented Mar 22, 2024

Changes from existing:

  1. incorporate programHash - e.g function verify(bytes32 programHash, bytes32 inputHash, bytes32 outputHash, bytes calldata proof) external returns (bool) along with passing programHash through all of our other funcs
  2. simplify registry - remove function ID / upgradeability and use reference to verifier address instead
    2a. maybe add transferOwnership() since doing the whitelist / custom prover calls with multisig can be annoying
  3. cancun evm version - TSTORE saves ~20k gas on fulfillCallback and ~60k gas on fulfillCall
  4. use calldata instead of memory for input / output / proof / context bytes - gas saving
  5. update libs - OZ switches to custom errors which significantly reduces bytecode size
  6. log verifier, callback, and prover addresses in fulfill events - helps when doing the off-chain accounting
  7. separate out the admin stuff (e.g. setFeeVault()) into an abstract contract
  8. rename contracts - NetworkGateway is NetworkStorage, NetworkAdmin, NetworkRegistry

src = "src"
out = "out"
libs = ["lib"]
evm_version = "cancun"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cancun is live on all the chains we deploy on except scroll, and they have an ETA of early April

}

interface INetworkGateway is INetworkGatewayEvents, INetworkGatewayErrors {
function requestCallback(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: these interfaces wont be backwards compatible with olds ones since verifer/programHash is used instead of functionID

@mattstam mattstam closed this Apr 5, 2024
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.

1 participant