-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge branch main into prerelease/2.0.0
- Loading branch information
Showing
98 changed files
with
4,769 additions
and
15,599 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cartesi/rollups": major | ||
--- | ||
|
||
Make `IAuthorityFactory` functions return `IAuthority` |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cartesi/rollups": minor | ||
--- | ||
|
||
Add `IOwnable` interface |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cartesi/rollups": major | ||
--- | ||
|
||
Made `ISelfHostedApplicationFactory` return `IApplication` |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cartesi/rollups": major | ||
--- | ||
|
||
Make `IQuorumFactory` functions return `IQuorum` |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cartesi/rollups": minor | ||
--- | ||
|
||
Add `IQuorum` interface |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cartesi/rollups": minor | ||
--- | ||
|
||
Add `IAuthority` interface |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// (c) Cartesi and individual authors (see AUTHORS) | ||
// SPDX-License-Identifier: Apache-2.0 (see LICENSE) | ||
|
||
pragma solidity ^0.8.8; | ||
|
||
/// @notice The interface of OpenZeppelin's `Ownable` contract. | ||
interface IOwnable { | ||
function owner() external view returns (address); | ||
function renounceOwnership() external; | ||
function transferOwnership(address newOwner) external; | ||
} |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// (c) Cartesi and individual authors (see AUTHORS) | ||
// SPDX-License-Identifier: Apache-2.0 (see LICENSE) | ||
|
||
pragma solidity ^0.8.8; | ||
|
||
import {IOwnable} from "../../access/IOwnable.sol"; | ||
import {IConsensus} from "../IConsensus.sol"; | ||
|
||
/// @notice A consensus contract controlled by a single address, the owner. | ||
interface IAuthority is IConsensus, IOwnable {} |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// (c) Cartesi and individual authors (see AUTHORS) | ||
// SPDX-License-Identifier: Apache-2.0 (see LICENSE) | ||
|
||
pragma solidity ^0.8.8; | ||
|
||
import {IConsensus} from "../IConsensus.sol"; | ||
|
||
/// @notice A consensus model controlled by a small, immutable set of `n` validators. | ||
/// @notice You can know the value of `n` by calling the `numOfValidators` function. | ||
/// @notice Upon construction, each validator is assigned a unique number between 1 and `n`. | ||
/// These numbers are used internally instead of addresses for gas optimization reasons. | ||
/// @notice You can list the validators in the quorum by calling the `validatorById` | ||
/// function for each ID from 1 to `n`. | ||
interface IQuorum is IConsensus { | ||
/// @notice Get the number of validators. | ||
function numOfValidators() external view returns (uint256); | ||
|
||
/// @notice Get the ID of a validator. | ||
/// @param validator The validator address | ||
/// @dev Validators have IDs greater than zero. | ||
/// @dev Non-validators are assigned to ID zero. | ||
function validatorId(address validator) external view returns (uint256); | ||
|
||
/// @notice Get the address of a validator by its ID. | ||
/// @param id The validator ID | ||
/// @dev Validator IDs range from 1 to `N`, the total number of validators. | ||
/// @dev Invalid IDs map to address zero. | ||
function validatorById(uint256 id) external view returns (address); | ||
|
||
/// @notice Get the number of validators in favor of a claim. | ||
/// @param appContract The application contract address | ||
/// @param lastProcessedBlockNumber The number of the last processed block | ||
/// @param claim The output Merkle root hash | ||
/// @return Number of validators in favor of claim | ||
function numOfValidatorsInFavorOf( | ||
address appContract, | ||
uint256 lastProcessedBlockNumber, | ||
bytes32 claim | ||
) external view returns (uint256); | ||
|
||
/// @notice Check whether a validator is in favor of a claim. | ||
/// @param appContract The application contract address | ||
/// @param lastProcessedBlockNumber The number of the last processed block | ||
/// @param claim The output Merkle root hash | ||
/// @param id The ID of the validator | ||
/// @return Whether validator is in favor of claim | ||
/// @dev Assumes the provided ID is valid. | ||
function isValidatorInFavorOf( | ||
address appContract, | ||
uint256 lastProcessedBlockNumber, | ||
bytes32 claim, | ||
uint256 id | ||
) external view returns (bool); | ||
} |
This file contains 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
Oops, something went wrong.