Skip to content

Commit

Permalink
remove gaslimit from ismp
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Mar 29, 2024
1 parent a22060d commit bd5219c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
6 changes: 0 additions & 6 deletions src/IDispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ struct DispatchPost {
bytes body;
// timeout for this request in seconds
uint64 timeout;
// gas limit for executing this request on destination & its response (if any) on the source.
uint64 gaslimit;
// the amount put up to be paid to the relayer, this is in $DAI and charged to tx.origin
uint256 fee;
// who pays for this request?
Expand All @@ -32,8 +30,6 @@ struct DispatchGet {
bytes[] keys;
// timeout for this request in seconds
uint64 timeout;
// gas limit for executing this request on destination & its response (if any) on the source.
uint64 gaslimit;
// the amount put up to be paid to the relayer, this is in $DAI and charged to tx.origin
uint256 fee;
// who pays for this request?
Expand All @@ -47,8 +43,6 @@ struct DispatchPostResponse {
bytes response;
// timeout for this response in seconds
uint64 timeout;
// gas limit for executing this response on destination which is the source of the request.
uint64 gaslimit;
// the amount put up to be paid to the relayer, this is in $DAI and charged to tx.origin
uint256 fee;
// who pays for this request?
Expand Down
12 changes: 3 additions & 9 deletions src/Message.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ struct PostRequest {
uint64 timeoutTimestamp;
// request body
bytes body;
// gas limit for executing this request on destination & its response (if any) on the source.
uint64 gaslimit;
}

struct GetRequest {
Expand All @@ -38,8 +36,6 @@ struct GetRequest {
bytes[] keys;
// height at which to read destination state machine
uint64 height;
// gas limit for executing this request on destination
uint64 gaslimit;
}

struct GetResponse {
Expand All @@ -56,8 +52,6 @@ struct PostResponse {
bytes response;
// timestamp by which this response times out.
uint64 timeoutTimestamp;
// gas limit for executing this response on destination which is the source of the request.
uint64 gaslimit;
}

// A post request as a leaf in a merkle tree
Expand Down Expand Up @@ -170,13 +164,13 @@ library Message {

function encodeRequest(PostRequest memory req) internal pure returns (bytes memory) {
return abi.encodePacked(
req.source, req.dest, req.nonce, req.timeoutTimestamp, req.from, req.to, req.body, req.gaslimit
req.source, req.dest, req.nonce, req.timeoutTimestamp, req.from, req.to, req.body
);
}

function hash(PostResponse memory res) internal pure returns (bytes32) {
return keccak256(
bytes.concat(encodeRequest(res.request), abi.encodePacked(res.response, res.timeoutTimestamp, res.gaslimit))
bytes.concat(encodeRequest(res.request), abi.encodePacked(res.response, res.timeoutTimestamp))
);
}

Expand All @@ -193,7 +187,7 @@ library Message {

return keccak256(
abi.encodePacked(
req.source, req.dest, req.nonce, req.height, req.timeoutTimestamp, req.from, keysEncoding, req.gaslimit
req.source, req.dest, req.nonce, req.height, req.timeoutTimestamp, req.from, keysEncoding
)
);
}
Expand Down

0 comments on commit bd5219c

Please sign in to comment.