VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Blockchain Time and Deadlines: Which Clock Does the Rule Use?

Three students in school uniforms work through open books at a classroom table, with textbooks and stationery nearby and study notes on the whiteboard behind them.

中文版 · Blockchain learning guide · Previous article

Blockchain learning · Extension BCX002

Three students in school uniforms work through open books at a classroom table, with textbooks and stationery nearby and study notes on the whiteboard behind them.
Study photograph for illustration; it does not establish that the pictured students are studying blockchain.

A request sent before a deadline can still fail a blockchain application’s time condition. The application may evaluate the timestamp of the block that executes it, rather than the user’s click time, a server’s receipt time or the moment a reader later observes finality. To decide the case, identify the clock and the exact comparison before looking at the dates.

This lesson supplies a fictional deadline ledger with slots, missing blocks, late inclusion and different observations of time. You will evaluate each request under one explicit rule, compare it with a different protocol clock, and write a decision that does not confuse timely submission with timely execution.

Every case is synthetic and nonfinancial. No real transaction, booking, account or deadline is acted on. The numbers are classroom clock coordinates unless a separate Unix-time example is explicitly identified. They are not a recommendation for a production timeout or an interpretation of a legal deadline.

Choose your reading route

In this guide

Sections 1–3 define the clocks and fixed rule. Sections 4–7 work through requests, missed slots and equality. Sections 8–10 compare protocol-specific clocks and changing chain evidence. Finish with the evidence note and exercises. For the broader social and technical role of time, see How Shared Time Keeps Society Synchronised.

Back to contents · Next section

1. Give every time value a job

A blockchain workflow can contain several times without any of them being erroneous. The user records when they pressed submit. An interface records when it received the request. A block supplies an execution timestamp. A reader records when they obtained a receipt or finality evidence. An external report may carry the time a physical event allegedly occurred.

These values answer different questions. A submission time helps describe the user’s action. A protocol timestamp is part of the context in which specified rules are evaluated. An observation time describes when the reader learned something. An external event time requires its own evidence; inclusion in a block does not manufacture that evidence.

A useful deadline statement therefore names a field and an inequality. “Before the deadline” is incomplete if the reader does not know whether equality is allowed, which clock is used and what event must have happened by then.

For example, “the application accepts only when the executing block timestamp is at most D” differs from “the gateway received the request before D.” Neither wording should silently replace the other after a request fails.

Back to contents · Next section

2. Read the fictional chain’s clock specification

Our toy chain uses numbered slots. Slot s has clock value 1000 + 12 × s, measured in seconds on a shared classroom coordinate system. Slot 0 corresponds to 1000, slot 4 to 1048, slot 5 to 1060, slot 6 to 1072 and slot 7 to 1084. These small numbers are not actual Ethereum timestamps or calendar dates.

For this dossier, a valid block’s execution timestamp must equal its slot’s clock value. A slot can pass without a block. Block height counts the accepted blocks in the supplied history, not every slot opportunity.

The history contains a block at slot 4 with height 50 and timestamp 1048, followed by a block at slot 5 with height 51 and timestamp 1060. Slot 6 has no block. The next supplied block is at slot 7, height 52, timestamp 1084. We stipulate that these blocks otherwise satisfy the toy protocol’s rules.

This separates three coordinates: slot, height and timestamp. From height 51 to 52 there is one additional block, but the timestamp difference is 24 seconds because a slot was missed. A rule based on height would not automatically be equivalent to a rule based on elapsed seconds.

Back to contents · Next section

3. Freeze the application deadline

The application accepts a fictional exhibition-entry request only when the executing block timestamp is less than or equal to 1060. All other application conditions are supplied as satisfied in each independent case. Each case begins from a fresh fixture; requests do not compete for capacity or change one another’s eligibility.

A time-condition failure leaves the tracked entry state unchanged under this toy rule. We do not infer real-network fees, account nonce treatment or general failure semantics. The question is whether this particular deadline predicate passes.

The gateway’s receipt time, the user’s display time and a claimed physical-event time are not inputs to this rule. They remain useful evidence for other questions, but cannot override the specified execution context.

The application also does not require finality to be observed by 1060. Finality evidence remains important for deciding whether the accepted history can be relied on, but this predicate is evaluated during execution. Adding a finality-by-deadline requirement would create a different policy.

Back to contents · Next section

4. Evaluate the first three requests

Case A: the request is submitted at 1040 and executes in the slot 4 block with timestamp 1048. Since 1048 ≤1060, the time condition passes. This conclusion uses the executing block’s timestamp; the earlier submission time is consistent background.

Case B: the request is submitted at 1055, but does not execute until the slot 7 block with timestamp 1084. The time condition fails because 1084 is greater than 1060. The fact that 1055 precedes the deadline does not grant an exception that the rule never included.

Case C: the request is submitted at 1058 and executes in the slot 5 block with timestamp 1060. It passes at equality. A reader obtains valid finality evidence for that accepted block at classroom observation time 1100. The later observation does not retroactively change 1060 into 1100 for the execution predicate.

Case C does not prove that finality is unimportant. It means execution-time qualification and the reader’s later confidence in the accepted history are separate parts of the record. The correct report retains both instead of choosing whichever time produces the preferred answer.

Back to contents · Next section

5. A screen clock and an event report cannot rewrite the predicate

Case D: the interface still displays 1050 when the request executes in the block with timestamp 1084. The interface display is stale in the supplied case. The application’s time condition fails. Refreshing the interface afterward does not change the block context that was used.

Case E: a separately authenticated report says the relevant physical exhibition preparation was completed at 1045. The report reaches the application only in the slot 7 block at 1084. Assume the report is reliable for the physical fact. The application still fails its execution-time condition because it has no rule admitting late reports of earlier events.

This is a design distinction, not a judgement that the physical report is false. A different application might intentionally accept verified evidence of an earlier event within a later reporting window. It would need to define the evidence authority, reporting period and comparison explicitly. Those conditions are absent here.

Case F: an off-chain preview evaluates the request with supplied block context 1059 and predicts that the time predicate would pass. The actual request later executes at 1084. It fails under the real supplied execution context. The preview answered a conditional question about 1059; it did not reserve an inclusion opportunity or promise a future block timestamp.

Back to contents · Next section

6. Missing blocks make height arithmetic a different question

The last eligible block in the supplied history is at slot 5, height 51, timestamp 1060. There is no block at slot 6. A request first included at the next block, height 52, executes at 1084 and misses the time deadline.

It would be wrong to estimate the next block time as 1060 +12 simply because height advanced by one. The stipulated slot schedule permits the missing slot, and the observed next block belongs to slot 7. Its time is determined by the slot rule, not by multiplying the height difference by 12.

Now consider an independent alternative policy: accept through height 52 inclusive. Under that different policy, the slot 7 request would meet the height threshold. That does not repair its failure under the original timestamp policy. It illustrates why a specification must not interchange “one more block,” “one more slot” and “twelve more seconds.”

The history does not establish a guaranteed future inclusion time. Even knowing the clock assigned to a future slot cannot prove that a block will exist there, that a particular request will be included, or that it will satisfy every other validation condition.

Back to contents · Next section

7. Equality is a policy choice with a visible consequence

The original rule uses timestamp ≤1060, so execution at 1060 passes. Change the rule to timestamp <1060 and the same execution fails. The facts have not changed; the boundary condition has.

If a new application version adopts the strict rule, record its activation point and evaluate requests under the version actually applicable to their execution. Do not rewrite an earlier result merely because someone later prefers different wording.

The distinction also matters for interfaces. “Closes at 1060” is ambiguous unless the interface explains the implemented comparison and event. A countdown based on the reader’s device clock can provide orientation, but it cannot itself guarantee timely block inclusion.

A clearer classroom label would say: “This rule accepts execution timestamps through 1060 inclusive; submission alone does not establish acceptance.” For a real product, wording would need to match the actual protocol, implementation and applicable obligations rather than borrowing this toy threshold.

Back to contents · Next section

8. Read the protocol source instead of applying one timestamp slogan

The Solidity 0.8.30 language documentation identifies block.timestamp as the current block timestamp in seconds since the Unix epoch. It also cautions that off-chain evaluation receives block context from the executing implementation. A language field name does not, by itself, specify every consensus constraint on its value.

For a concrete protocol layer, Ethereum’s Bellatrix consensus specification checks the execution payload timestamp against the time computed for the slot. This is a versioned specification example, not evidence that Bellatrix is the latest deployed upgrade. It is enough to show why an unqualified claim that every Ethereum proposer freely chooses any timestamp is unsuitable.

Bitcoin provides a different clock example. BIP 113 specifies median time-past for the relevant lock-time calculation, using the previous 11 block timestamps rather than simply the candidate block’s timestamp. Its current page marks the specification Deployed and records assignment on 10 August 2015.

These references support a method: identify the exact network, rule version, field and comparison. Do not transplant a warning, guarantee or deadline formula from one protocol into another merely because both contain block timestamps.

Back to contents · Next section

9. Work a separate median-clock comparison

This independent numerical example uses actual-shaped Unix-second values, unlike the small classroom clock above. Suppose the eleven relevant prior-block timestamps, already sorted for calculation, are 1700000000 through 1700000010 in one-second steps. Their median is the sixth value, 1700000005.

The candidate block’s own timestamp is supplied as 1700000020. A comparison based on median time-past therefore uses 1700000005, not 1700000020. The candidate’s larger displayed time cannot replace the specified median.

For a narrowly defined lock-time comparison requiring the time threshold to be strictly below the comparison time, a threshold of 1700000005 does not pass when the comparison time equals 1700000005. If a separate subsequent case supplies median 1700000006, that numerical comparison passes.

This is only the stated time comparison. It is not a complete Bitcoin transaction-validity determination, construction guide or guarantee of inclusion. We assume the comparison applies in the hypothetical case and do not model sequence-field exceptions, scripts, funding, fees or other requirements. No transaction is created or submitted.

Notice the contrast with our exhibition application’s inclusive deadline: equality passed there and fails in this separately supplied strict comparison. Neither answer is inconsistent. The two rules ask different questions with different clocks and inequalities.

Back to contents · Next section

10. Keep the deadline result attached to the accepted history

Consider one final independent variation. A request executes in a block with timestamp 1060 and passes the exhibition deadline. The observer has not obtained finality evidence. The dossier then explicitly supplies a chain reorganisation that removes that block from the selected history.

The old successful execution is no longer evidence of an accepted entry in the newly selected history. Its receipt belongs to the removed branch. If the request is eligible for another attempt under all other supplied rules, and that attempt executes at 1084, the deadline predicate now fails. Eligibility for another attempt is a premise of this variation, not an automatic recovery guarantee.

Do not carry the earlier success forward simply because the request identifier is familiar. Equally, do not describe the original evaluation as an arithmetic mistake: 1060 satisfied the rule on that branch. What changed is the history in which the reader is assessing acceptance.

This variation explains why a complete evidence note preserves block identity and the reader’s finality context alongside time. A bare timestamp cannot tell the whole story of whether an effect remains accepted.

Back to contents · Next section

11. Write a deadline evidence note

A useful note includes the request identity, network and rule version, exact time predicate, executing block identity and timestamp, observed application result, and finality evidence or its absence. Keep submission and observation times as separate labelled fields.

For Case B, the model note is: “The request was submitted at 1055 but executed in the supplied slot 7 block at 1084. Under the active timestamp ≤1060 rule, the time condition failed. Earlier submission does not satisfy this execution-time requirement.”

For Case C: “The request executed at 1060 and passed the inclusive condition. Valid finality evidence was observed at 1100. The rule did not require finality observation by 1060, so that later observation does not change the execution result.”

For Case E, add that the reliable physical report concerns 1045 while execution occurred at 1084. The report might support a different administrative question, but the application contains no late-report exception. This wording preserves both facts without making up a policy remedy.

Back to contents · Next section

Exercise: decide which clock controls

Use the original inclusive exhibition rule unless the question says otherwise.

  1. Submit at 1055, execute at 1084: pass or fail?
  2. Execute at 1060, finality observed at 1100: does the later observation make the time condition fail?
  3. The next block after height 51 is height 52 at slot 7. Is its timestamp necessarily 1072?
  4. A reliable event report says 1045, but executes at 1084. Does the original rule accept it?
  5. Change only the predicate to timestamp <1060. Does execution at 1060 pass?
  6. With the eleven sorted median-example values, should the comparison use 1700000020 or 1700000005?

Answers: 1 fails because execution is late. 2 does not fail for that reason; equality passed and finality observation is a separate field. 3 no, the supplied timestamp is 1084 after the missed slot. 4 no, the rule uses execution time and provides no reporting exception. 5 fails under the new strict predicate. 6 uses 1700000005, the median, for the specified comparison.

For a further check, remove the executing block identity and timestamp from Case B, leaving only submission 1055. The deadline result becomes unknown from that reduced evidence. Do not assume success simply because submission was early, or failure simply because the interface later looked delayed.

Back to contents · Next section

Frequently asked questions

Does a block timestamp prove when an outside event occurred?

Not by itself. It supplies protocol context. An outside-event claim needs its own evidence and an application rule explaining how that evidence is used.

Can a user guarantee inclusion by sending early?

No guarantee follows from the submission time alone. The dossier’s late-inclusion case shows the difference. A real system’s behaviour requires its actual protocol and operating conditions.

Is block height a clock?

It can be the input to a height-based rule, but it is not interchangeable with elapsed seconds. Our missed-slot example changes one without the other advancing in a fixed ratio.

Does a simulator prove a real deadline outcome?

It can establish the result under its supplied context. It does not establish the timestamp or inclusion of a future real execution. See the environment lesson for how to record that boundary.

Back to contents · Next section

Sources and further reading

The reliable question is not simply “was it before the deadline?” It is “which event, measured by which clock, satisfied which rule in which accepted history?”

Back to contents