Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Jul 23, 2025

Introduces the gas clock, an extension of a proxytime.Time[gas.Gas] that also tracks a "continuous" equivalent of ACP-176 gas excess at gas-unit resolution instead of per second.

Closes #11

Copy link

Copilot AI left a comment

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 introduces a new gastime package that implements a "gas clock" - a time measurement system based on gas consumption rather than traditional time units. The implementation extends proxtime.Time[gas.Gas] to track both time passage and a continuous equivalent of ACP-176 gas excess at gas-unit resolution.

Key changes:

  • Gas-based time tracking with excess consumption monitoring per ACP-176/194
  • Canoto serialization support for persistence and network transmission
  • Comprehensive test coverage for scaling operations and excess calculations

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
go.mod Adds uint256 dependency for geth/libevm compatibility
gastime/gastime.go Core Time struct with gas-based time tracking and excess management
gastime/marshal.go Canoto serialization interface and marshaling methods
gastime/marshal.canoto.go Generated canoto marshaling implementation
gastime/gastime_test.go Comprehensive tests for scaling, excess calculations, and cloning
gastime/cmpopt.go Test utilities for comparing Time instances

Copy link
Contributor

@StephenButtolph StephenButtolph left a comment

Choose a reason for hiding this comment

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

Really my only questions/concerns are cases of potential overflow.

@ARR4N ARR4N linked an issue Sep 8, 2025 that may be closed by this pull request
@ARR4N ARR4N merged commit 13ad8fe into main Sep 10, 2025
11 checks passed
@ARR4N ARR4N deleted the arr4n/gastime branch September 10, 2025 17:09
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.

gastime package production readiness

3 participants