Skip to content

docs: add Transaction Context page (gl.message, datetime, tx params)#407

Merged
MuncleUscles merged 1 commit into
mainfrom
docs/transaction-context
May 13, 2026
Merged

docs: add Transaction Context page (gl.message, datetime, tx params)#407
MuncleUscles merged 1 commit into
mainfrom
docs/transaction-context

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

Summary

  • Adds a dedicated Transaction Context page covering gl.message, gl.message_raw, and — importantly — the fact that datetime.now() / time.time() are deterministic inside the GenVM (the WASI clock is seeded with the transaction datetime).
  • Moves the gl.message field table out of messages.mdx (it was execution context, not message-passing semantics) and replaces it with a one-line link.
  • Slots the new page between Value Transfers and Messages in _meta.json.

Motivation

Searching the docs for timestamp turns up nothing useful — only a passing u32 use-case mention and a non-determinism warning about API timestamps. There was no documentation of:

  • How to get the transaction datetime inside a contract.
  • That datetime.now() is safe and deterministic (the canonical source of non-determinism in normal Python — devs reasonably assume it would break equivalence).
  • The extra fields on gl.message_raw (datetime, is_init, entry_kind, stack).
  • What's not in the context (block number, gas price, wall-clock).

Confirmed against genvm/runners/genlayer-py-std/src/genlayer/_internal/msg.py and genvm/executor/src/wasi/preview1.rs:379 (clock seeded with unix_timestamp from the message). Pattern is already in production use in Rally (XID.py, CampaignShard.py).

Test plan

  • pnpm dev and verify the new page renders under Developers → Intelligent Contracts → Features → Transaction Context
  • Verify the link from messages.mdx resolves
  • Verify nav order: Value Transfers → Transaction Context → Messages

…params

The current docs only document the 5 typed gl.message fields under
"Messages", with no mention of the transaction datetime, gl.message_raw,
or the fact that datetime.now() is deterministic inside the GenVM
(seeded by the tx datetime via WASI). This left devs guessing about
how to get timestamps and what global tx params are available.

- New features/transaction-context.mdx with gl.message, gl.message_raw,
  deterministic time usage, and what's not exposed (block number, gas,
  wall-clock).
- Drop the "Message Context" table from messages.mdx and link over.
- Slot the new page between value-transfers and messages in _meta.json.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@MuncleUscles has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes and 3 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fbf05483-fed5-43f4-9f41-d462b87738b7

📥 Commits

Reviewing files that changed from the base of the PR and between fa991e2 and 363fb80.

📒 Files selected for processing (3)
  • pages/developers/intelligent-contracts/features/_meta.json
  • pages/developers/intelligent-contracts/features/messages.mdx
  • pages/developers/intelligent-contracts/features/transaction-context.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/transaction-context

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 13, 2026

Deploy Preview for genlayer-docs ready!

Name Link
🔨 Latest commit 363fb80
🔍 Latest deploy log https://app.netlify.com/projects/genlayer-docs/deploys/6a045a820eecb10008574a77
😎 Deploy Preview https://deploy-preview-407--genlayer-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@MuncleUscles MuncleUscles merged commit 2d9f071 into main May 13, 2026
8 checks passed
@MuncleUscles MuncleUscles deleted the docs/transaction-context branch May 13, 2026 11: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.

1 participant