Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions contracts-abi/abi/PreconfManager.abi
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@
"name": "zkProof",
"type": "uint256[]",
"internalType": "uint256[]"
},
{
"name": "bidOptions",
"type": "bytes",
"internalType": "bytes"
}
]
}
Expand Down Expand Up @@ -306,6 +311,11 @@
"name": "revertingTxHashes",
"type": "string",
"internalType": "string"
},
{
"name": "bidOptions",
"type": "bytes",
"internalType": "bytes"
}
]
}
Expand Down Expand Up @@ -385,6 +395,11 @@
"name": "revertingTxHashes",
"type": "string",
"internalType": "string"
},
{
"name": "bidOptions",
"type": "bytes",
"internalType": "bytes"
}
]
}
Expand Down Expand Up @@ -670,6 +685,11 @@
"name": "zkProof",
"type": "uint256[]",
"internalType": "uint256[]"
},
{
"name": "bidOptions",
"type": "bytes",
"internalType": "bytes"
}
]
}
Expand Down Expand Up @@ -758,6 +778,11 @@
"name": "revertingTxHashes",
"type": "string",
"internalType": "string"
},
{
"name": "bidOptions",
"type": "bytes",
"internalType": "bytes"
}
],
"stateMutability": "view"
Expand Down Expand Up @@ -1102,6 +1127,11 @@
"name": "zkProof",
"type": "uint256[]",
"internalType": "uint256[]"
},
{
"name": "bidOptions",
"type": "bytes",
"internalType": "bytes"
}
]
}
Expand Down Expand Up @@ -1341,6 +1371,12 @@
"type": "uint64",
"indexed": false,
"internalType": "uint64"
},
{
"name": "bidOptions",
"type": "bytes",
"indexed": false,
"internalType": "bytes"
}
],
"anonymous": false
Expand Down
82 changes: 45 additions & 37 deletions contracts-abi/clients/PreconfManager/PreconfManager.go

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions contracts/contracts/core/PreconfManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ contract PreconfManager is
/// @dev EIP-712 Type Hash for preconfirmation bid
bytes32 public constant EIP712_BID_TYPEHASH =
keccak256(
"PreConfBid(string txnHash,string revertingTxHashes,uint256 bidAmt,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,uint256 slashAmt,uint256 bidderPKx,uint256 bidderPKy)"
"PreConfBid(string txnHash,string revertingTxHashes,uint256 bidAmt,uint64 blockNumber,uint64 decayStartTimeStamp,uint64 decayEndTimeStamp,uint256 slashAmt,uint256 bidderPKx,uint256 bidderPKy,bytes bidOptions)"
);

// Hex characters
Expand Down Expand Up @@ -285,7 +285,8 @@ contract PreconfManager is
commitmentDigest,
unopenedCommitment.commitmentSignature,
params.txnHash,
params.revertingTxHashes
params.revertingTxHashes,
params.bidOptions
);

commitmentIndex = getOpenedCommitmentIndex(newCommitment);
Expand Down Expand Up @@ -481,7 +482,8 @@ contract PreconfManager is
params.decayEndTimeStamp,
params.slashAmt,
params.zkProof[2], // _bidderPKx,
params.zkProof[3] // _bidderPKy
params.zkProof[3], // _bidderPKy
keccak256(params.bidOptions)
Comment thread
aloknerurkar marked this conversation as resolved.
)
)
);
Expand Down Expand Up @@ -627,7 +629,8 @@ contract PreconfManager is
newCommitment.txnHash,
newCommitment.revertingTxHashes,
newCommitment.commitmentDigest,
newCommitment.dispatchTimestamp
newCommitment.dispatchTimestamp,
newCommitment.bidOptions
);
}

Expand Down
5 changes: 4 additions & 1 deletion contracts/contracts/interfaces/IPreconfManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface IPreconfManager {
bytes commitmentSignature;
string txnHash;
string revertingTxHashes;
bytes bidOptions;
}

/// @dev Struct for all the commitment params to avoid too deep in the stack error
Expand Down Expand Up @@ -52,6 +53,7 @@ interface IPreconfManager {
// the public key of the bidder (zkProof[2], zkProof[3]), the shared key (zkProof[4], zkProof[5]),
// the challenge (zkProof[6]), and the response (zkProof[7])
uint256[] zkProof;
bytes bidOptions; // The encoded options
}

/// @dev Struct for all the information around unopened preconfirmations commitment
Expand All @@ -76,7 +78,8 @@ interface IPreconfManager {
string txnHash,
string revertingTxHashes,
bytes32 commitmentDigest,
uint64 dispatchTimestamp
uint64 dispatchTimestamp,
bytes bidOptions
);

/// @dev Event to log successful unopened commitment storage
Expand Down
12 changes: 8 additions & 4 deletions contracts/test/core/OracleTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@ contract OracleTest is Test {
txnHashes[i],
revertingTxHashes,
bidSignatures[i],
zkProof
zkProof,
hex""
)
);
vm.stopPrank();
Expand Down Expand Up @@ -705,7 +706,8 @@ contract OracleTest is Test {
params.txnHash,
params.revertingTxHashes,
hex"",
params.zkProof
params.zkProof,
hex""
)
);
(uint8 v, bytes32 r, bytes32 s) = vm.sign(params.bidderPk, bidHash);
Expand Down Expand Up @@ -747,7 +749,8 @@ contract OracleTest is Test {
txnHash,
revertingTxHashes,
hex"",
zkproof
zkproof,
hex""
)
);
}
Expand Down Expand Up @@ -824,7 +827,8 @@ contract OracleTest is Test {
txnHash,
revertingTxHashes,
bidSignature,
zkproof
zkproof,
hex""
)
);
vm.stopPrank();
Expand Down
Loading
Loading