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 various request types #11

Open
4000D opened this issue Jun 11, 2019 · 1 comment
Open

add various request types #11

4000D opened this issue Jun 11, 2019 · 1 comment

Comments

@4000D
Copy link
Contributor

4000D commented Jun 11, 2019

Current apply functions only takes enter and exit request. They should be extended to support escape and undo request.

function applyRequestInRootChain(
    bool isExit,
    uint256 requestId,
    address requestor,
    bytes32 trieKey,
    bytes trieValue
) external returns (bool success);

function applyRequestInChildChain(
    bool isExit,
    uint256 requestId,
    address requestor,
    bytes32 trieKey,
    bytes trieValue
) external returns (bool success);

apply functions should be divided into request types, not chains.

function startEnter(
    bool isRootChain,
    uint256 requestId,
    address requestor,
    bytes32 trieKey,
    bytes trieValue
) external returns (bool success);

function startExit(
    bool isRootChain,
    uint256 requestId,
    address requestor,
    bytes32 trieKey,
    bytes trieValue
) external returns (bool success);

function startEscape(
    bool isRootChain,
    uint256 requestId,
    address requestor,
    bytes32 trieKey,
    bytes trieValue
) external returns (bool success);

function startUndo(
    bool isRootChain,
    uint256 requestId,
    address requestor,
    bytes32 trieKey,
    bytes trieValue
) external returns (bool success);
@4000D
Copy link
Contributor Author

4000D commented Jun 11, 2019

Undo request which cancels previous enter request have to refer the trieValue of previous enter request. I think it is enough to include this information in trieValue of previous request.

trieValue of enter request must be [current_value, value_to_request] to roll back the state to current_value before enter request is applied. And trieValue of undo request must be same as the enter request to be undone.

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

No branches or pull requests

1 participant