diff --git a/src/lib/op/evm/LibOpBlockNumber.sol b/src/lib/op/evm/LibOpBlockNumber.sol index 2c348ae39..37ef1f477 100644 --- a/src/lib/op/evm/LibOpBlockNumber.sol +++ b/src/lib/op/evm/LibOpBlockNumber.sol @@ -32,9 +32,12 @@ library LibOpBlockNumber { } /// @notice Reference implementation of `block-number` for testing. - /// Uses the float conversion with exponent 0 to verify that - /// `fromFixedDecimalLosslessPacked(value, 0)` is identity, unlike `run()` - /// which stores the raw value directly as a gas optimization. + /// `run()` writes the raw EVM integer directly because + /// `fromFixedDecimalLosslessPacked(x, 0)` is bitwise-identical to + /// `bytes32(x)` for any `x` that fits in `int224` — an invariant + /// owned and tested by `LibDecimalFloat`. The reference path goes + /// through the float conversion so that fact is explicit at the + /// opcode boundary. /// @return The output values to push onto the stack. function referenceFn(InterpreterState memory, OperandV2, StackItem[] memory) internal diff --git a/src/lib/op/evm/LibOpBlockTimestamp.sol b/src/lib/op/evm/LibOpBlockTimestamp.sol index 6a0fdaf95..7d408c2bd 100644 --- a/src/lib/op/evm/LibOpBlockTimestamp.sol +++ b/src/lib/op/evm/LibOpBlockTimestamp.sol @@ -32,9 +32,12 @@ library LibOpBlockTimestamp { } /// @notice Reference implementation of `block-timestamp` for testing. - /// Uses the float conversion with exponent 0 to verify that - /// `fromFixedDecimalLosslessPacked(value, 0)` is identity, unlike `run()` - /// which stores the raw value directly as a gas optimization. + /// `run()` writes the raw EVM integer directly because + /// `fromFixedDecimalLosslessPacked(x, 0)` is bitwise-identical to + /// `bytes32(x)` for any `x` that fits in `int224` — an invariant + /// owned and tested by `LibDecimalFloat`. The reference path goes + /// through the float conversion so that fact is explicit at the + /// opcode boundary. /// @return The output values to push onto the stack. function referenceFn(InterpreterState memory, OperandV2, StackItem[] memory) internal diff --git a/src/lib/op/evm/LibOpChainId.sol b/src/lib/op/evm/LibOpChainId.sol index 3ca258c63..82d96ba76 100644 --- a/src/lib/op/evm/LibOpChainId.sol +++ b/src/lib/op/evm/LibOpChainId.sol @@ -32,9 +32,12 @@ library LibOpChainId { } /// @notice Reference implementation of `chain-id` for testing. - /// Uses the float conversion with exponent 0 to verify that - /// `fromFixedDecimalLosslessPacked(value, 0)` is identity, unlike `run()` - /// which stores the raw value directly as a gas optimization. + /// `run()` writes the raw EVM integer directly because + /// `fromFixedDecimalLosslessPacked(x, 0)` is bitwise-identical to + /// `bytes32(x)` for any `x` that fits in `int224` — an invariant + /// owned and tested by `LibDecimalFloat`. The reference path goes + /// through the float conversion so that fact is explicit at the + /// opcode boundary. /// @return The output values to push onto the stack. function referenceFn(InterpreterState memory, OperandV2, StackItem[] memory) internal