Open hats-bug-reporter[bot] opened 3 months ago
For example understanding:
Recommendation to fix:
+ function setWitnessPublicKeys(bytes[] calldata publicKeys) public onlyOwner {
+ TEERollup.WitnessActivation[] storage _witness = new TEERollup.WitnessActivation[](publicKeys.length);
+ for (uint i = 0; i < _witness.length; i++) {
+ _witness[i].publicKey = publicKeys[i];
+ _witness[i].isActive = true;
+ }
+ _setWitnessPublicKeys(_witness);
+ }
@party-for-illuminati toggleWitnessPublicKey()
would be used to toggle the ALREADY set public keys which were either active or inactive.
and the above recommended setWitnessPublicKeys()
public function would set the number of witness public keys by calling it once instead of repeating for each public key. Further, _setWitnessPublicKeys()
as internal function has not been used across inscope contracts.
Can you please clarify how _setWitnessPublicKeys()
is expected to be used in contracts and how multiple witness public keys will be set to active?
Github username: -- Twitter username: -- Submission hash (on-chain): 0xa2699d44be4821a5f8fa7ef6755c08cc5b7e7436b4566722d09b09fba5f77d85 Severity: medium
Description: Description\
TEERollup.sol
is a base contract which is inherited byBitcoinProver.sol
contract.To set the witness public key, this base contract has implemented:
However, this
internal
function is not used byBitcoinProver.sol
contract to set the witness public keys. This means that, witness public keys can not be set in BitcoinProver contract.It should be noted that.
BitcoinProver.sol
has implemented function to set minimum witness signature i.esetMinWitnessConfirmations()
but missed to implement thesetWitnessPublicKeys
function.This would affect the
verifyComputations()
function as it would revert for the givenFullComputationsProof
as it wont be able to verify the witness signatures.BitcoinProver.sol
must implement thesetWitnessPublicKeys()
in order to prevent its functionalities from breaking and the functionalities would be useless whereever they make used of witness public keys.Recommendations\
Consider impelmenting
setWitnessPublicKeys
public function inBitcoinProver.sol
contract.