docs: add Transaction Context page (gl.message, datetime, tx params)#407
Conversation
…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.
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
✅ Deploy Preview for genlayer-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary
gl.message,gl.message_raw, and — importantly — the fact thatdatetime.now()/time.time()are deterministic inside the GenVM (the WASI clock is seeded with the transaction datetime).gl.messagefield table out ofmessages.mdx(it was execution context, not message-passing semantics) and replaces it with a one-line link._meta.json.Motivation
Searching the docs for
timestampturns up nothing useful — only a passingu32use-case mention and a non-determinism warning about API timestamps. There was no documentation of:datetime.now()is safe and deterministic (the canonical source of non-determinism in normal Python — devs reasonably assume it would break equivalence).gl.message_raw(datetime,is_init,entry_kind,stack).Confirmed against
genvm/runners/genlayer-py-std/src/genlayer/_internal/msg.pyandgenvm/executor/src/wasi/preview1.rs:379(clock seeded withunix_timestampfrom the message). Pattern is already in production use in Rally (XID.py,CampaignShard.py).Test plan
pnpm devand verify the new page renders under Developers → Intelligent Contracts → Features → Transaction Contextmessages.mdxresolves