-
Notifications
You must be signed in to change notification settings - Fork 48
docs(v2): Rollups 2.0 migration, community tools, and self-hosted updates #353
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
Open
riseandshaheen
wants to merge
7
commits into
main
Choose a base branch
from
docs/v2-rollups-docs-updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
08cc5d5
docs(v2): update Rollups 2.0 migration, community tools, and self-hos…
riseandshaheen f589a5e
docs(v2): align contracts API with rollups-contracts v3.0.0-alpha.9
riseandshaheen 7eb25da
docs(v2): fix self-hosted and EW guides for working testnet deploy
riseandshaheen 7f814f6
docs(v2): add self-hosted good practices for longer-lived nodes
riseandshaheen 75ee02d
docs(v2): restructure self-hosted standard deployment guide
riseandshaheen 911b18f
docs(v2): polish migration guide and add whitepaper sidebar link
riseandshaheen 281f88a
docs(v2): unhide 2.0 alpha as the default Rollups version
riseandshaheen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,26 +2,42 @@ | |||||
| id: application-factory | ||||||
| title: ApplicationFactory | ||||||
| resources: | ||||||
| - url: https://github.com/cartesi/rollups-contracts/tree/v3.0.0-alpha.6/src/dapp/ApplicationFactory.sol | ||||||
| - url: https://github.com/cartesi/rollups-contracts/tree/v3.0.0-alpha.9/src/dapp/ApplicationFactory.sol | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| title: Application Factory contract | ||||||
| - url: https://github.com/cartesi/rollups-contracts/tree/v3.0.0-alpha.9/src/dapp/IApplicationFactory.sol | ||||||
| title: IApplicationFactory interface | ||||||
| --- | ||||||
|
|
||||||
| <!-- Reviewed for Cartesi Rollups v2.0 documentation. --> | ||||||
|
|
||||||
| The **ApplicationFactory** contract is a tool for reliably deploying new instances of the [`Application`](../contracts/application.md) contract with or without a specified salt value for address derivation. | ||||||
|
|
||||||
| Additionally, it provides a function to calculate the address of a potential new `CartesiDApp` contract based on input parameters. | ||||||
| Additionally, it provides a function to calculate the address of a potential new `Application` contract based on input parameters. | ||||||
|
|
||||||
| This contract ensures efficient and secure deployment of `Application` contracts within the Cartesi Rollups framework. | ||||||
| The factory takes an [`IRefundOutputBuilder`](https://github.com/cartesi/rollups-contracts/tree/v3.0.0-alpha.9/src/refund/IRefundOutputBuilder.sol) in its constructor. That refund builder is a factory-wide immutable: every application deployed by this factory shares it, and it is not part of `WithdrawalConfig` or of `newApplication` parameters. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ## Functions | ||||||
|
|
||||||
| ### `constructor()` | ||||||
|
|
||||||
| ```solidity | ||||||
| constructor(IRefundOutputBuilder refundOutputBuilder) | ||||||
| ``` | ||||||
|
|
||||||
| **Parameters** | ||||||
|
|
||||||
| | Name | Type | Description | | ||||||
| |------|------|-------------| | ||||||
| | `refundOutputBuilder` | `IRefundOutputBuilder` | Factory-wide builder used for deposit refunds after foreclosure | | ||||||
|
|
||||||
| ### `newApplication()` | ||||||
|
|
||||||
| ```solidity | ||||||
| function newApplication( | ||||||
| IOutputsMerkleRootValidator outputsMerkleRootValidator, | ||||||
| address appOwner, | ||||||
| bytes32 templateHash, | ||||||
| bytes calldata dataAvailability, | ||||||
| IInputBox inputBox, | ||||||
| WithdrawalConfig calldata withdrawalConfig | ||||||
| ) external override returns (IApplication) | ||||||
| ``` | ||||||
|
|
@@ -35,7 +51,7 @@ Deploys a new Application contract without a salt value for address derivation. | |||||
| | `outputsMerkleRootValidator` | `IOutputsMerkleRootValidator` | The initial outputs Merkle root validator contract | | ||||||
| | `appOwner` | `address` | Address of the owner of the application | | ||||||
| | `templateHash` | `bytes32` | Hash of the template for the application | | ||||||
| | `dataAvailability` | `bytes` | The data availability solution | | ||||||
| | `inputBox` | `IInputBox` | The input box contract | | ||||||
| | `withdrawalConfig` | `WithdrawalConfig` | The withdrawal configuration (see [WithdrawalConfig](./withdrawal/withdrawal-config.md)). Pass a zero-valued config to deploy without emergency withdrawal | | ||||||
|
|
||||||
| **Return Values** | ||||||
|
|
@@ -51,7 +67,7 @@ function newApplication( | |||||
| IOutputsMerkleRootValidator outputsMerkleRootValidator, | ||||||
| address appOwner, | ||||||
| bytes32 templateHash, | ||||||
| bytes calldata dataAvailability, | ||||||
| IInputBox inputBox, | ||||||
| WithdrawalConfig calldata withdrawalConfig, | ||||||
| bytes32 salt | ||||||
| ) external override returns (IApplication) | ||||||
|
|
@@ -66,7 +82,7 @@ Deploys a new `Application` contract with a specified salt value for address der | |||||
| | `outputsMerkleRootValidator` | `IOutputsMerkleRootValidator` | The initial outputs Merkle root validator contract | | ||||||
| | `appOwner` | `address` | Address of the owner of the application | | ||||||
| | `templateHash` | `bytes32` | Hash of the template for the application | | ||||||
| | `dataAvailability` | `bytes` | The data availability solution | | ||||||
| | `inputBox` | `IInputBox` | The input box contract | | ||||||
| | `withdrawalConfig` | `WithdrawalConfig` | The withdrawal configuration (see [WithdrawalConfig](./withdrawal/withdrawal-config.md)). Pass a zero-valued config to deploy without emergency withdrawal | | ||||||
| | `salt` | `bytes32` | Salt value for address derivation | | ||||||
|
|
||||||
|
|
@@ -83,7 +99,7 @@ function calculateApplicationAddress( | |||||
| IOutputsMerkleRootValidator outputsMerkleRootValidator, | ||||||
| address appOwner, | ||||||
| bytes32 templateHash, | ||||||
| bytes calldata dataAvailability, | ||||||
| IInputBox inputBox, | ||||||
| WithdrawalConfig calldata withdrawalConfig, | ||||||
| bytes32 salt | ||||||
| ) external view override returns (address) | ||||||
|
|
@@ -98,7 +114,7 @@ Calculates the address of a potential new Application contract based on input pa | |||||
| | `outputsMerkleRootValidator` | `IOutputsMerkleRootValidator` | The initial outputs Merkle root validator contract | | ||||||
| | `appOwner` | `address` | Address of the owner of the application | | ||||||
| | `templateHash` | `bytes32` | Hash of the template for the application | | ||||||
| | `dataAvailability` | `bytes` | The data availability solution | | ||||||
| | `inputBox` | `IInputBox` | The input box contract | | ||||||
| | `withdrawalConfig` | `WithdrawalConfig` | The withdrawal configuration (see [WithdrawalConfig](./withdrawal/withdrawal-config.md)). Pass a zero-valued config to deploy without emergency withdrawal | | ||||||
| | `salt` | `bytes32` | Salt value for address derivation | | ||||||
|
|
||||||
|
|
@@ -108,16 +124,24 @@ Calculates the address of a potential new Application contract based on input pa | |||||
| |------|------|-------------| | ||||||
| | `[0]` | `address` | Address of the potential new Application contract | | ||||||
|
|
||||||
| ### `version()` | ||||||
|
|
||||||
| ```solidity | ||||||
| function version() external view returns (string memory) | ||||||
| ``` | ||||||
|
|
||||||
| Return the rollups-contracts package version string. | ||||||
|
|
||||||
| ## Events | ||||||
|
|
||||||
| ### `ApplicationCreated()` | ||||||
|
|
||||||
| ```solidity | ||||||
| event ApplicationCreated( | ||||||
| IOutputsMerkleRootValidator outputsMerkleRootValidator, | ||||||
| IOutputsMerkleRootValidator indexed outputsMerkleRootValidator, | ||||||
| address appOwner, | ||||||
| bytes32 templateHash, | ||||||
| bytes dataAvailability, | ||||||
| IInputBox inputBox, | ||||||
| WithdrawalConfig withdrawalConfig, | ||||||
| IApplication appContract | ||||||
| ) | ||||||
|
|
@@ -132,8 +156,8 @@ A new Application contract was deployed. | |||||
| | `outputsMerkleRootValidator` | `IOutputsMerkleRootValidator` | The outputs Merkle root validator contract | | ||||||
| | `appOwner` | `address` | The owner of the application | | ||||||
| | `templateHash` | `bytes32` | The template hash | | ||||||
| | `dataAvailability` | `bytes` | The data availability solution | | ||||||
| | `withdrawalConfig` | `WithdrawalConfig` | The withdrawal configuration (see [WithdrawalConfig](./withdrawal/withdrawal-config.md)). Pass a zero-valued config to deploy without emergency withdrawal | | ||||||
| | `inputBox` | `IInputBox` | The input box contract | | ||||||
| | `withdrawalConfig` | `WithdrawalConfig` | The withdrawal configuration | | ||||||
| | `appContract` | `IApplication` | The deployed Application contract | | ||||||
|
|
||||||
| ## Errors | ||||||
|
|
@@ -146,8 +170,20 @@ error InvalidWithdrawalConfig(WithdrawalConfig withdrawalConfig) | |||||
|
|
||||||
| Raised at deployment when the provided [`WithdrawalConfig`](./withdrawal/withdrawal-config.md) is invalid, meaning its accounts-drive layout does not fit inside the machine memory (see [`LibWithdrawalConfig.isValid`](./withdrawal/withdrawal-config.md#validation)). Checking the config in the factory means users and the node do not have to check it themselves. | ||||||
|
|
||||||
| **Parameters** | ||||||
| ## Self-hosted factory | ||||||
|
|
||||||
| | Name | Type | Description | | ||||||
| |------|------|-------------| | ||||||
| | `withdrawalConfig` | `WithdrawalConfig` | The invalid withdrawal configuration | | ||||||
| [`ISelfHostedApplicationFactory`](https://github.com/cartesi/rollups-contracts/tree/v3.0.0-alpha.9/src/dapp/ISelfHostedApplicationFactory.sol) deploys an Authority + Application pair in one transaction. | ||||||
|
|
||||||
| ```solidity | ||||||
| function deployContracts( | ||||||
| address authorityOwner, | ||||||
| uint256 epochLength, | ||||||
| uint256 claimStagingPeriod, | ||||||
| bytes32 templateHash, | ||||||
| IInputBox inputBox, | ||||||
| WithdrawalConfig calldata withdrawalConfig, | ||||||
| bytes32 salt | ||||||
| ) external returns (IApplication, IAuthority); | ||||||
| ``` | ||||||
|
|
||||||
| There is no `appOwner` parameter: the factory deploys the application under its own ownership and immediately renounces it, so self-hosted applications are ownerless and cannot migrate to another outputs Merkle root validator after deployment. `calculateAddresses` takes the same arguments (without returning ownership control). | ||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed a couple of pages have this addition.
It might need cleanup