Skip to content

Switch deadlines to block.timestamp; refresh proto decoders#2

Merged
hhl42 merged 3 commits into
mainfrom
blocktime
May 2, 2026
Merged

Switch deadlines to block.timestamp; refresh proto decoders#2
hhl42 merged 3 commits into
mainfrom
blocktime

Conversation

@hhl42

@hhl42 hhl42 commented May 2, 2026

Copy link
Copy Markdown
Contributor
  • Beaking change: migrates deadline / challenge-window / timeout from block.number to block.timestamp
  • Refreshes Pb.sol / PbChain.sol / PbEntity.sol to the latest pb3-gen-sol output

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates all on-chain deadline/challenge-window semantics from block numbers to Unix timestamps (block.timestamp) and refreshes the Solidity protobuf decoders (Pb.sol, PbChain.sol, PbEntity.sol) from the latest generator output.

Changes:

  • Replace deadline/timeout comparisons and stored time fields from block.number to block.timestamp across ledger, pay resolution, registry, and migration logic.
  • Update Solidity tests to use vm.warp(...) and adjust assertions/events to timestamp-based deadlines.
  • Regenerate protobuf decoder libraries and update proto sources + documentation/gas baselines accordingly.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/utils/Base.t.sol Warp timestamp in base setup to avoid underflow in timestamp math across tests.
test/gas_logs/fine_granularity/IntendSettle-OneState.txt Update committed gas baseline values.
test/gas_logs/fine_granularity/ClearPays.txt Update committed gas baseline values.
test/gas_logs/VirtContractResolver.txt Update committed gas baseline values.
test/gas_logs/PayResolver.txt Update committed gas baseline values.
test/gas_logs/CelerLedger-Migrate.txt Update committed gas baseline values.
test/gas_logs/CelerLedger-ETH.txt Update committed gas baseline values.
test/gas_logs/CelerLedger-ERC20.txt Update committed gas baseline values.
test/RouterRegistry.t.sol Switch tests to timestamp-based liveness tracking and add timestamp anchoring.
test/PayResolver.t.sol Switch resolve-deadline logic to timestamps; add tests for not-finalized dependent conditions.
test/PayRegistry.t.sol Switch finalization checks/tests to timestamp semantics.
test/GasReport.t.sol Use vm.warp and timestamp-based deadlines in gas measurement harness.
test/CelerLedger.Migrate.t.sol Update migration deadline tests to timestamps.
test/CelerLedger.ETH.t.sol Update channel/withdraw/settle deadline tests from block roll to timestamp warp.
test/CelerLedger.ERC20.t.sol Update settle/confirm timing to timestamps.
src/lib/ledgerlib/LedgerStruct.sol Document settle/dispute fields as timestamp/seconds-based.
src/lib/ledgerlib/LedgerOperation.sol Core ledger operations now use block.timestamp for deadlines/timeouts.
src/lib/ledgerlib/LedgerMigrate.sol Migration deadline enforcement switched to block.timestamp.
src/lib/interface/IRouterRegistry.sol Update interface docs to timestamp semantics.
src/lib/interface/IPayRegistry.sol Update interface docs to timestamp semantics.
src/lib/interface/ICelerLedger.sol Update interface docs for timestamp-based settle/withdraw intent timing.
src/lib/data/proto/entity.proto Proto formatting/metadata refresh (copyright, ordering, typos).
src/lib/data/proto/chain.proto Proto formatting/metadata refresh (copyright, ordering, whitespace).
src/lib/data/PbEntity.sol Regenerated protobuf entity decoders (new decoding approach + helpers).
src/lib/data/PbChain.sol Regenerated protobuf chain decoders.
src/lib/data/Pb.sol Regenerated protobuf runtime support library (new primitive decoders).
src/helper/NumericCondMock.sol Update mock to decode finalization/outcome from query bytes for richer testing.
src/helper/BooleanCondMock.sol Update mock to decode finalization/outcome from query bytes for richer testing.
src/RouterRegistry.sol Store router liveness as timestamp instead of block number.
src/PayResolver.sol Resolve logic now uses timestamps for pay deadlines/timeouts.
src/PayRegistry.sol Finalization checks now use timestamps.
src/CelerLedgerMock.sol Keep mock ledger consistent with timestamp-based timing.
docs/contracts.md Update documentation to describe timestamp-based deadlines and router timestamps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/data/PbEntity.sol
Comment thread src/lib/data/PbEntity.sol
Comment thread src/lib/data/PbChain.sol
Comment thread src/lib/data/PbEntity.sol
@hhl42 hhl42 merged commit fdb4f5a into main May 2, 2026
6 checks passed
@hhl42 hhl42 deleted the blocktime branch May 2, 2026 07:27
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