Skip to content

Feature Request: Expose block timestamp in gl.message or gl.block #77

@flow475

Description

@flow475

Context:

I am building Rule 60, a multiplayer AI judged game on GenLayer.
During development I needed block timestamps for:

  • Override vote windows (10 second expiry after round submission)
  • Session timeout/deadlock recovery (1 hour inactivity threshold)
  • Weekly leaderboard epoch calculation

Current situation:
gl.message.sender_address works correctly.
gl.message.timestamp raises:

AttributeError: 'MessageType' object has no attribute 'timestamp'

What I am requesting:
A canonical block timestamp accessible inside contracts, similar to:

  • Ethereum's block.timestamp
  • Solana's Clock::get()?.unix_timestamp

Suggested interface:

gl.message.block_timestamp → int (Unix seconds)
gl.block.timestamp → int (Unix seconds)

Why this matters for GenLayer specifically:
Without timestamps, any time gated logic must be delegated to a
trusted offchain oracle. This undermines the trustless guarantee
that makes GenLayer valuable. DeFi expiry, governance deadlines,
game timers, subscription payments; all of these require timestamps
to be autonomous and verifiable onchain.

I understand the consensus challenge which is: validators running independently
may have different local times. But a possible solution is to include a
canonical timestamp in the block header that all validators use,
similar to how Ethereum validators agree on block.timestamp
during block proposal.

Happy to discuss further or test any proposed implementation.

Built with: GenLayer Bradbury testnet
Contract type: Intelligent Contract with run_nondet_unsafe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions