Skip to content

[ci] adopt forge 1.8.0 - #978

Open
claude[bot] wants to merge 2 commits into
mainfrom
ci/adopt-forge-1-8-0
Open

[ci] adopt forge 1.8.0#978
claude[bot] wants to merge 2 commits into
mainfrom
ci/adopt-forge-1-8-0

Conversation

@claude

@claude claude Bot commented Aug 28, 2026

Copy link
Copy Markdown

Foundry's stable channel went 1.7.1 -> 1.8.0 on 2026-08-27, and the toolchain action pins itself but not the forge binary, so the expanded linter reddened lint on main with no change on our side: 125 findings, 106 in src/, 18 in certora/, 1 in a transitive lib/ file.

This stops linting certora/ (the target is now just src, there is no script/) and adopts the rule exclusions settled in morpho-org/midnight#1168, which together cover 64 of the 106 src findings. The remaining 42 are acknowledged in place with the existing forge-lint directive idiom. No version pin, and --deny notes stays.

Comments only in src/: the diff adds 38 directive lines and removes nothing, so the bytecode is unchanged.


Generated by Claude Code

claude and others added 2 commits August 28, 2026 15:06
…orce

Foundry's stable channel moved 1.7.1 -> 1.8.0 on 2026-08-27. The toolchain
action is pinned by sha but the forge binary it installs is not, so the
expanded 1.8.0 linter reddened the lint job with no change on our side:
125 findings, 106 in src/, 18 in certora/ and 1 in a transitive lib/ file.

Stop linting certora/: the rules that fire there (repeated literals, one
contract per file, external-function) describe the normal shape of a spec
harness rather than defects. That disposes of the 18 certora findings.
The repo has no script/ directory, so the target is just src.

Also adopt the rule exclusions settled on in midnight#1168, which covers
64 of the 106 src findings. --deny notes stays, so strictness is unchanged
for the code that ships; only the scope narrows.

Co-authored-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
The 42 src findings the exclusions do not cover are acknowledged at the
site with the repo's existing forge-lint directive idiom, each naming the
reason the rule does not apply:

- reentrancy-events (14): the emit is last on purpose, so it reports the
  post-interaction state. In the three factories the external call is the
  CREATE2 deployment whose address the event carries.
- missing-events-access-control (6): every flagged write is reported by the
  Allocate, Deallocate, Deposit or Transfer event alongside it.
- unsafe-typecast (6): block.timestamp fits uint64, the msg.data casts want
  only the leading bytes4, and allocation is bounded by absoluteCap.
- uninitialized-local (4): each flagged local is read at its zero default
  deliberately - two loop counters, and minted/burned shares that are zero
  exactly when no assets moved.
- unused-import (4): src/imports/*.sol are compile-forcing shims, so the
  imported symbol is deliberately unreferenced.
- ecrecover (3): s-malleability is handled by the nonce, not the signature.
- costly-loop (2): swap-and-pop writes storage once, then breaks.
- reentrancy-no-eth (1): adapters are set through a timelock.
- unused-error (1), cache-array-length (1).

Comments only: the src diff adds 38 directive lines and removes nothing, so
the bytecode is unchanged.

Co-authored-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
Comment on lines +166 to +167
// forge-lint: disable-next-item(reentrancy-events) the event is emitted after the vault calls on purpose, once
// the cap check passed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you infer too much things ^^

Suggested change
// forge-lint: disable-next-item(reentrancy-events) the event is emitted after the vault calls on purpose, once
// the cap check passed.
// forge-lint: disable-next-item(reentrancy-events) ack.

Comment on lines +140 to +141
// forge-lint: disable-next-item(reentrancy-events) the event is emitted after the vault calls on purpose, once
// the cap check passed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same

Comment on lines +17 to 18
// forge-lint: disable-next-item(unused-error) part of the error catalogue, kept even though no code path uses it.
error CapExceeded();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove it instead

Comment thread src/VaultV2.sol
Comment on lines +592 to 593
// forge-lint: disable-next-item(uninitialized-local) i is meant to start at zero.
for (uint256 i; i < ids.length; i++) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

actually initialise i (and double check that it doesn't change the compiled bytecode)

Comment thread src/VaultV2.sol
Comment on lines +606 to +607
// forge-lint: disable-next-item(reentrancy-events) the event is emitted last so it reports the allocation after
// the adapter call.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just put ack

Comment thread src/VaultV2.sol
Comment on lines +595 to +596
// forge-lint: disable-next-item(missing-events-access-control,unsafe-typecast) the Allocate event below
// reports the change, and allocation is bounded by absoluteCap < 2**128.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why do we even have the missing event here?

Comment thread src/VaultV2.sol
{
require(isAdapter[adapter], ErrorsLib.NotAdapter());

// forge-lint: disable-next-item(reentrancy-no-eth) adapters are set through a timelock, so they are trusted.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// forge-lint: disable-next-item(reentrancy-no-eth) adapters are set through a timelock, so they are trusted.
// forge-lint: disable-next-item(reentrancy-no-eth) adapters are trusted to not reenter.

Comment thread src/VaultV2.sol
// forge-lint: disable-next-item(reentrancy-no-eth) adapters are set through a timelock, so they are trusted.
(bytes32[] memory ids, int256 change) = IAdapter(adapter).deallocate(data, assets, msg.sig, msg.sender);

// forge-lint: disable-next-item(uninitialized-local) i is meant to start at zero.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

init i

Comment thread src/VaultV2.sol
for (uint256 i; i < ids.length; i++) {
Caps storage _caps = caps[ids[i]];
require(_caps.allocation > 0, ErrorsLib.ZeroAllocation());
// forge-lint: disable-next-item(missing-events-access-control,unsafe-typecast) the Deallocate event below

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same q

Comment thread src/VaultV2.sol
Comment on lines +635 to +636
// forge-lint: disable-next-item(reentrancy-events) the event is emitted last so it reports the allocation after
// the adapter call.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants