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

chore(deps): bump solidity version to 0.8.22 #246

Merged
merged 2 commits into from
Oct 30, 2023
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
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[profile.default]
solc_version = "0.8.21"
solc_version = "0.8.22"
via_ir = true
gas_reports = ["*"]
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fs from "fs";

const config: HardhatUserConfig = {
solidity: {
version: "0.8.21",
version: "0.8.22",
settings: {
optimizer: {
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion scripts/Dockerfile_Environment
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apt update && apt install -y git build-essential software-properties-common
RUN curl -L https://foundry.paradigm.xyz | bash && . /root/.bashrc && foundryup

# install solc
RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.21/solc-static-linux -O /usr/bin/solc && chmod +x /usr/bin/solc
RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.22/solc-static-linux -O /usr/bin/solc && chmod +x /usr/bin/solc

# install go
RUN wget https://go.dev/dl/go1.21.1.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.1.linux-amd64.tar.gz && echo 'PATH=$PATH:/usr/local/go/bin:/root/go/bin' >> ~/.bashrc
Expand Down
40 changes: 18 additions & 22 deletions src/Blobstream.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;
rach-id marked this conversation as resolved.
Show resolved Hide resolved

import "openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol";
import "openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
Expand Down Expand Up @@ -198,27 +198,23 @@
uint256 _powerThreshold
) private pure {
uint256 cumulativePower = 0;
// Note: be cautious when updating the code inside the unchecked block.
// Make sure to verify if all the bypassed security checks are respected.
unchecked {
for (uint256 i = 0; i < _currentValidators.length; i++) {
// If the signature is nil, then it's not present so continue.
if (isSigNil(_sigs[i])) {
continue;
}

// Check that the current validator has signed off on the hash.
if (!verifySig(_currentValidators[i].addr, _digest, _sigs[i])) {
revert InvalidSignature();
}

// Sum up cumulative power.
cumulativePower += _currentValidators[i].power;

// Break early to avoid wasting gas.
if (cumulativePower >= _powerThreshold) {
break;
}
for (uint256 i = 0; i < _currentValidators.length; i++) {
// If the signature is nil, then it's not present so continue.
if (isSigNil(_sigs[i])) {
continue;
}

// Check that the current validator has signed off on the hash.
if (!verifySig(_currentValidators[i].addr, _digest, _sigs[i])) {
revert InvalidSignature();
}

// Sum up cumulative power.
cumulativePower += _currentValidators[i].power;

// Break early to avoid wasting gas.
if (cumulativePower >= _powerThreshold) {
break;
}
}
// Check that there was enough power.
Expand Down
2 changes: 1 addition & 1 deletion src/Constants.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

Check warning

Code scanning / Slither

Incorrect versions of Solidity Warning

Pragma version^0.8.22 necessitates a version too recent to be trusted. Consider deploying with 0.8.18.

/// @dev bytes32 encoding of the string "checkpoint"
bytes32 constant VALIDATOR_SET_HASH_DOMAIN_SEPARATOR =
Expand Down
2 changes: 1 addition & 1 deletion src/DataRootTuple.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

Check warning

Code scanning / Slither

Incorrect versions of Solidity Warning

Pragma version^0.8.22 necessitates a version too recent to be trusted. Consider deploying with 0.8.18.

/// @notice A tuple of data root with metadata. Each data root is associated
/// with a Celestia block height.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/Constants.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "./Types.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/Types.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

/// @notice A representation of the Celestia-app namespace ID and its version.
/// See: https://celestiaorg.github.io/celestia-app/specs/namespace.html
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/Utils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "./Constants.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/binary/BinaryMerkleProof.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

/// @notice Merkle Tree Proof structure.
struct BinaryMerkleProof {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/binary/BinaryMerkleTree.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "../Constants.sol";
import "../Utils.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/binary/TreeHasher.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "../Constants.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/binary/test/BinaryMerkleTree.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "ds-test/test.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/binary/test/TreeHasher.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "ds-test/test.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/namespace/NamespaceMerkleMultiproof.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "./NamespaceNode.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/namespace/NamespaceMerkleProof.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "./NamespaceNode.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/namespace/NamespaceMerkleTree.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "../Constants.sol";
import "../Types.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/namespace/NamespaceNode.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "../Types.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/namespace/TreeHasher.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "../Constants.sol";
import "../Types.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "ds-test/test.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "ds-test/test.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/namespace/test/TreeHasher.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "ds-test/test.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tree/test/Utils.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "ds-test/test.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/verifier/DAVerifier.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/verifier/test/DAVerifier.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/verifier/test/RollupInclusionProofs.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/test/Blobstream.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.22;

import "openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";

Expand Down
2 changes: 1 addition & 1 deletion wrappers/Blobstream.sol/wrapper.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wrappers/ERC1967Proxy.sol/wrapper.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.