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

add retryable revival #38

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/precompiles/ArbRetryableTx.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,40 @@ interface ArbRetryableTx {
*/
function keepalive(bytes32 ticketId) external returns (uint256);

/**
* @notice Brings back to life ticketId.
* Donate gas to pay for the lifetime extension.
* If successful, emits LifetimeExtended event.
* Revert if proof is wrong or ticketId was already revived.
* @param ticketId unique ticket identifier
* @param numTries number of pre-expiry retries
* @param from address of the retryable submitter
* @param to retryable's recipient
* @param callvalue retryable's callvalue
* @param beneficiary retryable's benficiary
* @param rootHash the merkle root to prove against
* @param leafIndex merkle leaf index that is proved
* @param proof merkle proof of the retryable's inclusion in expired accumulator
* @return new timeout of ticketId
*/
function revive(
bytes32 ticketId,
uint64 numTries,
address from,
address to,
uint256 callvalue,
address beneficiary,
bytes calldata retryData,
bytes32 rootHash,
uint64 leafIndex,
bytes32[] calldata proof
) external returns (uint256);

/**
* @notice Return root hash and tree size from last expired root snapshot
*/
function getLastExpiredRootSnapshot() external view returns (bytes32, uint64);

/**
* @notice Return the beneficiary of ticketId.
* Revert if ticketId doesn't exist.
Expand Down Expand Up @@ -96,6 +130,30 @@ interface ArbRetryableTx {
/// @dev DEPRECATED in favour of new RedeemScheduled event after the nitro upgrade
event Redeemed(bytes32 indexed userTxHash);

/**
* @notice logs a merkle branch for expired proof synthesis
* @param hash the merkle hash
* @param position = (level << 192) + leaf
*/
event ExpiredMerkleUpdate(bytes32 indexed hash, uint256 indexed position);

/**
* @notice logs a merkle leaf for expired proof synthesis
* @param ticketId unique ticket identifier
* @param hash the merkle hash
* @param position = (level << 192) + leaf
* @param numTries number of pre-expiry retries
*/
event RetryableExpired(
bytes32 indexed hash,
uint256 indexed position,
bytes32 indexed ticketId,
uint64 numTries
);

error NoTicketWithID();
error NotCallable();
error AlreadyRevived();
error InvalidRootHash();
error WrongProof();
}
Loading