Skip to content

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dferendo committed Feb 7, 2024
1 parent ddd2b50 commit f718898
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions src/lib/verifier/test/DAVerifier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ contract DAVerifierTest is DSTest {
function setUp() public {
fixture = new TestFixture();

uint256 initialVelsetNonce = 1;
uint256 initialValsetNonce = 1;

validators.push(Validator(cheats.addr(testPriv1), votingPower));
bytes32 hash = computeValidatorSetHash(validators);
bytes32 checkpoint = domainSeparateValidatorSetHash(initialVelsetNonce, (2 * votingPower) / 3, hash);
bytes32 checkpoint = domainSeparateValidatorSetHash(initialValsetNonce, (2 * votingPower) / 3, hash);
bridge = new Blobstream();
bridge.initialize(initialVelsetNonce, (2 * votingPower) / 3, checkpoint);
bridge.initialize(initialValsetNonce, (2 * votingPower) / 3, checkpoint);

bytes32 newDataRootTupleRoot =
domainSeparateDataRootTupleRoot(fixture.dataRootTupleRootNonce(), fixture.dataRootTupleRoot());
Expand All @@ -94,7 +94,7 @@ contract DAVerifierTest is DSTest {
valSet[0] = Validator(cheats.addr(testPriv1), votingPower);

bridge.submitDataRootTupleRoot(
fixture.dataRootTupleRootNonce(), initialVelsetNonce, fixture.dataRootTupleRoot(), valSet, sigs
fixture.dataRootTupleRootNonce(), initialValsetNonce, fixture.dataRootTupleRoot(), valSet, sigs
);

assertEq(bridge.state_eventNonce(), fixture.dataRootTupleRootNonce());
Expand Down
8 changes: 4 additions & 4 deletions src/lib/verifier/test/RollupInclusionProofs.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ contract RollupInclusionProofTest is DSTest {
// - initial valset.
// - data root tuple root that commits to the proofs tested below.
function setUp() public {
uint256 initialVelsetNonce = 1;
uint256 initialValsetNonce = 1;

validators.push(Validator(cheats.addr(testPriv1), votingPower));
bytes32 hash = computeValidatorSetHash(validators);
bytes32 checkpoint = domainSeparateValidatorSetHash(initialVelsetNonce, (2 * votingPower) / 3, hash);
bytes32 checkpoint = domainSeparateValidatorSetHash(initialValsetNonce, (2 * votingPower) / 3, hash);
bridge = new Blobstream();
bridge.initialize(initialVelsetNonce, (2 * votingPower) / 3, checkpoint);
bridge.initialize(initialValsetNonce, (2 * votingPower) / 3, checkpoint);

fixture = new TestFixture();

Expand All @@ -230,7 +230,7 @@ contract RollupInclusionProofTest is DSTest {
valSet[0] = Validator(cheats.addr(testPriv1), votingPower);

bridge.submitDataRootTupleRoot(
fixture.dataRootTupleRootNonce(), initialVelsetNonce, fixture.dataRootTupleRoot(), valSet, sigs
fixture.dataRootTupleRootNonce(), initialValsetNonce, fixture.dataRootTupleRoot(), valSet, sigs
);

assertEq(bridge.state_eventNonce(), fixture.dataRootTupleRootNonce());
Expand Down
24 changes: 12 additions & 12 deletions src/test/Blobstream.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ contract RelayerTest is DSTest {
CheatCodes cheats = CheatCodes(HEVM_ADDRESS);

function setUp() public {
uint256 initialVelsetNonce = 1;
uint256 initialValsetNonce = 1;

validators.push(Validator(cheats.addr(testPriv1), votingPower));
bytes32 hash = computeValidatorSetHash(validators);
bytes32 validatorSetCheckpoint = domainSeparateValidatorSetHash(initialVelsetNonce, (2 * votingPower) / 3, hash);
bytes32 validatorSetCheckpoint = domainSeparateValidatorSetHash(initialValsetNonce, (2 * votingPower) / 3, hash);
bridge = new Blobstream();
bridge.initialize(initialVelsetNonce, (2 * votingPower) / 3, validatorSetCheckpoint);
bridge.initialize(initialValsetNonce, (2 * votingPower) / 3, validatorSetCheckpoint);
}

function testUpdateValidatorSet() public {
uint256 initialVelsetNonce = 1;
uint256 initialValsetNonce = 1;

// Save the old test validator set before we add to it.
Validator[] memory oldVS = new Validator[](1);
Expand All @@ -59,15 +59,15 @@ contract RelayerTest is DSTest {
(uint8 v, bytes32 r, bytes32 s) = cheats.sign(testPriv1, digest_eip191);
sigs[0] = Signature(v, r, s);

bridge.updateValidatorSet(newNonce, initialVelsetNonce, newPowerThreshold, newVSHash, oldVS, sigs);
bridge.updateValidatorSet(newNonce, initialValsetNonce, newPowerThreshold, newVSHash, oldVS, sigs);

assertEq(bridge.state_eventNonce(), newNonce);
assertEq(bridge.state_powerThreshold(), newPowerThreshold);
assertEq(bridge.state_lastValidatorSetCheckpoint(), newCheckpoint);
}

function testSubmitDataRootTupleRoot() public {
uint256 initialVelsetNonce = 1;
uint256 initialValsetNonce = 1;
uint256 nonce = 2;
// 32 bytes, chosen at random.
bytes32 newTupleRoot = 0x0de92bac0b356560d821f8e7b6f5c9fe4f3f88f6c822283efd7ab51ad56a640e;
Expand All @@ -83,21 +83,21 @@ contract RelayerTest is DSTest {
Validator[] memory valSet = new Validator[](1);
valSet[0] = Validator(cheats.addr(testPriv1), votingPower);

bridge.submitDataRootTupleRoot(nonce, initialVelsetNonce, newTupleRoot, valSet, sigs);
bridge.submitDataRootTupleRoot(nonce, initialValsetNonce, newTupleRoot, valSet, sigs);

assertEq(bridge.state_eventNonce(), nonce);
assertEq(bridge.state_dataRootTupleRoots(nonce), newTupleRoot);
}

function testDeployContractAtCustomNonce() public {
uint256 initialVelsetNonce = 1;
uint256 initialValsetNonce = 1;
uint256 targetNonce = 200;

Validator[] memory valSet = new Validator[](1);
valSet[0] = Validator(cheats.addr(testPriv1), votingPower);

bytes32 hash = computeValidatorSetHash(valSet);
bytes32 validatorSetCheckpoint = domainSeparateValidatorSetHash(initialVelsetNonce, (2 * votingPower) / 3, hash);
bytes32 validatorSetCheckpoint = domainSeparateValidatorSetHash(initialValsetNonce, (2 * votingPower) / 3, hash);
Blobstream newBridge = new Blobstream();
newBridge.initialize(targetNonce, (2 * votingPower) / 3, validatorSetCheckpoint);

Expand All @@ -112,7 +112,7 @@ contract RelayerTest is DSTest {
(uint8 v, bytes32 r, bytes32 s) = cheats.sign(testPriv1, digest_eip191);
sigs[0] = Signature(v, r, s);

newBridge.submitDataRootTupleRoot(targetNonce + 1, initialVelsetNonce, newTupleRoot, valSet, sigs);
newBridge.submitDataRootTupleRoot(targetNonce + 1, initialValsetNonce, newTupleRoot, valSet, sigs);

assertEq(newBridge.state_eventNonce(), targetNonce + 1);
assertEq(newBridge.state_dataRootTupleRoots(targetNonce + 1), newTupleRoot);
Expand All @@ -128,7 +128,7 @@ contract RelayerTest is DSTest {
0x00000000000000000000000000000000000000000000000000000000000000030303030303030303030303030303030303030303030303030303030303030303
*/
function testVerifyAttestation() public {
uint256 initialVelsetNonce = 1;
uint256 initialValsetNonce = 1;
// data root tuple root nonce.
uint256 nonce = 2;
// commitment to a set of roots.
Expand Down Expand Up @@ -159,7 +159,7 @@ contract RelayerTest is DSTest {
Validator[] memory valSet = new Validator[](1);
valSet[0] = Validator(cheats.addr(testPriv1), votingPower);

bridge.submitDataRootTupleRoot(nonce, initialVelsetNonce, newTupleRoot, valSet, sigs);
bridge.submitDataRootTupleRoot(nonce, initialValsetNonce, newTupleRoot, valSet, sigs);

assertEq(bridge.state_eventNonce(), nonce);
assertEq(bridge.state_dataRootTupleRoots(nonce), newTupleRoot);
Expand Down
10 changes: 5 additions & 5 deletions src/test/BlobstreamBenchmark.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ contract Benchmark is DSTest {
CheatCodes cheats = CheatCodes(HEVM_ADDRESS);

function setUp() public {
uint256 initialVelsetNonce = 0;
uint256 initialValsetNonce = 0;
privateKeys = derivePrivateKeys(numberOfValidators);
validators = initializeValidators(privateKeys);

bytes32 hash = computeValidatorSetHash(validators);
bytes32 checkpoint = domainSeparateValidatorSetHash(initialVelsetNonce, (2 * totalValidatorPower) / 3, hash);
bytes32 checkpoint = domainSeparateValidatorSetHash(initialValsetNonce, (2 * totalValidatorPower) / 3, hash);
bridge = new Blobstream();
bridge.initialize(initialVelsetNonce, (2 * totalValidatorPower) / 3, checkpoint);
bridge.initialize(initialValsetNonce, (2 * totalValidatorPower) / 3, checkpoint);
}

function testBenchmarkSubmitDataRootTupleRoot() public {
uint256 initialVelsetNonce = 0;
uint256 initialValsetNonce = 0;
uint256 nonce = 1;

// 32 bytes, chosen at random.
Expand All @@ -83,7 +83,7 @@ contract Benchmark is DSTest {
// bridge.domainSeparateValidatorSetHash(nonce, currentPowerThreshold, currentValidatorSetHash);
// bridge.checkValidatorSignatures(validators, sigs, newDataRootTupleRoot, currentPowerThreshold);

bridge.submitDataRootTupleRoot(nonce, initialVelsetNonce, newTupleRoot, validators, sigs);
bridge.submitDataRootTupleRoot(nonce, initialValsetNonce, newTupleRoot, validators, sigs);
}

function computeValidatorSetHash(Validator[] memory _validators) private pure returns (bytes32) {
Expand Down

0 comments on commit f718898

Please sign in to comment.