Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/beacon_root/main.eas
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
caller ;; [caller]
push SYSADDR ;; [sysaddr, caller]
eq ;; [sysaddr == caller]
push @submit ;; [submit_lbl, sysaddr == caller]
jumpi ;; []
jumpi @submit ;; []

;; Fallthrough if addresses don't match -- this means the caller intends
;; to read a root.
Expand All @@ -62,8 +61,7 @@
eq ;; [calldatasize == 32]

;; Jump to continue if length-check passed, otherwise revert.
push @loadtime ;; [loadtime_lbl, calldatasize == 32]
jumpi ;; []
jumpi @loadtime ;; []
%do_revert() ;; []

loadtime:
Expand All @@ -74,8 +72,7 @@ loadtime:

;; Verify input timestamp is non-zero.
iszero ;; [input_timestamp == 0, input_timestamp]
push @throw ;; [throw_lbl, input_timestamp == 0, input_timestamp]
jumpi ;; [input_timestamp]
jumpi @throw ;; [input_timestamp]

;; Compute the timestamp index and load from storage.
push BUFLEN ;; [buflen, input_timestamp]
Expand All @@ -89,8 +86,7 @@ loadtime:
;; don't match if the slot has been overwritten by the ring buffer or if
;; the timestamp input wasn't a valid previous timestamp.
eq ;; [stored_timestamp == input_timestamp, time_index]
push @loadroot ;; [loadroot_lbl, input == timestamp, time_index]
jumpi ;; [time_index]
jumpi @loadroot ;; [time_index]
%do_revert() ;; []

loadroot:
Expand Down
Loading