Skip to content
Closed
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 cartesi-rollups/contracts/src/Merkle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ library Merkle {
/// @dev See `MerkleConstants` for leaf size.
function getHashOfLeafAtIndex(bytes calldata data, uint256 leafIndex) internal pure returns (bytes32) {
uint256 start = leafIndex << MerkleConstants.LOG2_LEAF_SIZE;
if (start < data.length) {
if (start < data.length && (start >> MerkleConstants.LOG2_LEAF_SIZE) == leafIndex) {
/// forge-lint: disable-next-line(asm-keccak256)
return keccak256(abi.encode(bytes32(data[start:])));
} else {
Expand Down
12 changes: 9 additions & 3 deletions test/Dockerfile
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem to pertain more to your other PR #226.
My suggestion is, now that you have write permissions to the repo:

  • Address all suggested changes.

  • Rebase fix/integer-overflow on top of fix/dockerized-env-tests

git checkout fix/integer-overflow
git rebase -i fix/dockerized-env-tests # Might require conflicts to be resolved
  • Push your branches from your fork to the upstream dave repo and make these PRs point to them.
git remote add upstream https://github.com/cartesi/dave.git
git fetch upstream
git push upstream fix/dockerized-env-tests
git push upstream fix/integer-overflow
  • Make your PRs point to the new branches on the dave repo (not to your fork branches)

  • Make this PR point have fix/dockerized-env-tests as its base branch

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN <<EOF
set -eu
apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git
curl -L https://foundry.paradigm.xyz | bash
~/.foundry/bin/foundryup --install stable
~/.foundry/bin/foundryup --install v1.5.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When bumping Foundry, we should make sure to:

  • update the Foundry version on the CI config.
  • run the Forge formatter on all Forge projects.

install -Dm755 ~/.foundry/bin/* /usr/local/bin/
EOF
# cargo binstall (to install just)
Expand All @@ -34,6 +34,11 @@ RUN \
xxd jq sqlite3; \
rm -rf /var/cache/apt;

# install pnpm
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash -
ENV PNPM_HOME="/root/.local/share/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

# install foundry
COPY --from=tools /usr/local/bin/forge /usr/local/bin/
COPY --from=tools /usr/local/bin/cast /usr/local/bin/
Expand Down Expand Up @@ -81,7 +86,9 @@ RUN \
--mount=type=cache,target=cartesi-rollups/contracts/cache,sharing=locked \
--mount=type=cache,target=prt/contracts/out,sharing=locked \
--mount=type=cache,target=prt/contracts/cache,sharing=locked \
just -f test/programs/justfile build-programs
just -f test/programs/justfile build-programs && \
just -f test/programs/justfile build-honeypot-snapshot && \
just -f cartesi-rollups/contracts/justfile build-devnet

# copy everything else
COPY \
Expand All @@ -105,5 +112,4 @@ RUN \
just build-rust-workspace; \
cp target/debug/cartesi-rollups-prt-node .

# because of `--mount`, we need to do this.
RUN mkdir -p target/debug && mv cartesi-rollups-prt-node target/debug/
Loading