Workspace IndexKnowledge NotesEng › Blocks are not seconds

#2379Review2026-09-16

Blocks are not seconds

Marek's keeper waits "5 blocks" before resolving a market. On the devnet a block is one second; on Sepolia it is twelve. The same code means five seconds in one place and a minute in the other.

Why this conversation

A review comment that points at a unit, not a person, and turns a bug into a rule the whole codebase can follow.

Dialogue

Jay: This waits five blocks before resolving. On the devnet that's five seconds. On Sepolia it's a minute. Which one did you mean?

Marek: I meant "a little while." Enough for the price to be there.

Jay: Then say the little while in seconds and read the chain's timestamp. Block counts change meaning every time we change chains, and we now have three.

Marek: The devnet's clock runs behind real time though.

Jay: Right, so compare block timestamps to each other, never to Date.now. Distance from the head is the honest measure.

Marek: Should I fix just this spot?

Jay: Fix this one, then grep for the pattern. If it's in three places, it's a rule, and the rule goes in the rails README so the next person doesn't relearn it.

Key expressions

Expression뜻 · 쓰이는 자리
which one did you mean?어느 쪽을 의도했나?
a little while잠깐
say it in seconds초 단위로 말하라
change meaning every time we change chains체인을 바꿀 때마다 의미가 바뀐다
runs behind real time실제 시간보다 뒤처진다
distance from the head헤드로부터의 거리
the honest measure정직한 척도
grep for the pattern패턴을 검색하라
if it's in three places, it's a rule세 곳에 있으면 규칙이다
relearn it다시 배우다

← English · All Notes · Top ↑

블록은 초가 아니다

Marek의 키퍼가 마켓 정산 전에 "5블록"을 기다린다. devnet에서 블록은 1초, Sepolia에서는 12초다. 같은 코드가 한쪽에서는 5초, 다른 쪽에서는 1분이다.

왜 이 대화인가

사람이 아니라 단위를 가리키는 리뷰 코멘트. 버그 하나를 코드베이스 전체가 따를 규칙으로 바꾼다.

대화

Jay: 이건 정산 전에 5블록을 기다리네요. devnet에서는 5초, Sepolia에서는 1분이에요. 어느 쪽을 의도한 거예요?

Marek: "잠깐"을 의도했어요. 가격이 도착할 만큼요.

Jay: 그럼 그 잠깐을 초로 말하고 체인의 타임스탬프를 읽어요. 블록 수는 체인을 바꿀 때마다 의미가 바뀌고, 이제 체인이 셋이잖아요.

Marek: 그런데 devnet 시계는 실제 시간보다 뒤처져 있는데요.

Jay: 맞아요. 그래서 블록 타임스탬프끼리 비교하고 Date.now와는 절대 비교하지 않아요. 헤드로부터의 거리가 정직한 척도죠.

Marek: 이 부분만 고칠까요?

Jay: 이건 고치고 패턴을 grep해 봐요. 세 곳에 있으면 규칙이고, 규칙은 rails README에 들어가서 다음 사람이 다시 배우지 않게 해요.

협업 기법 세 가지

  1. 두 환경의 결과를 나란히 보여준다. "five seconds… a minute. Which one did you mean?" 잘못됐다고 말하지 않고 두 해석을 놓으면 상대가 스스로 고른다.
  2. 단위를 바꾸라고 말한다. "say the little while in seconds" 코드가 아니라 단위에 대한 코멘트는 개인 공격으로 읽히지 않는다.
  3. 한 번의 수정을 규칙으로 승격한다. "If it's in three places, it's a rule." 같은 리뷰를 다음 달에 다시 하지 않는 방법.

← English · 전체 노트 · 맨 위 ↑