diff --git a/src/consolidations/main.eas b/src/consolidations/main.eas index 2292cac..ec13812 100644 --- a/src/consolidations/main.eas +++ b/src/consolidations/main.eas @@ -296,9 +296,9 @@ accum_loop: push 32 ;; [32, offset, slotbase, ..] add ;; [offset=offset+32, slotbase, ..] - ;; Read slot 'spk2_tpk1' from stoarge. + ;; Read slot 'spk2_tpk1' from storage. dup2 ;; [slotbase, offset, slotbase, ..] - push 2 ;; [1, slotbase, offset, slotbase, ..] + push 2 ;; [2, slotbase, offset, slotbase, ..] add ;; [slot, offset, slotbase, ..] sload ;; [spk2_tpk1, offset, slotbase, ..] diff --git a/src/execution_hash/main.eas b/src/execution_hash/main.eas index dd0d21b..04a4707 100644 --- a/src/execution_hash/main.eas +++ b/src/execution_hash/main.eas @@ -53,7 +53,8 @@ jumpi @throw ;; [input] ;; Check if the input is requesting a block hash before the earliest available - ;; hash currently. Since we've verfied that input <= number - 1, it's safe to + ;; hash currently. Since we've verified that input <= number - 1, we know + ;; there will be no overflow during the subtraction of number - input. push BUFLEN ;; [buflen, input] dup2 ;; [input, buflen, input] number ;; [number, input, buflen, input] diff --git a/src/withdrawals/main.eas b/src/withdrawals/main.eas index 93408e2..45190a7 100644 --- a/src/withdrawals/main.eas +++ b/src/withdrawals/main.eas @@ -166,7 +166,7 @@ handle_input: ;; Increment queue tail over last and write to storage. push 1 ;; [1, tail_idx] add ;; [tail_idx+1] - push QUEUE_TAIL ;; [tail_idx_slot] + push QUEUE_TAIL ;; [tail_idx_slot, tail_idx+1] sstore ;; [] stop @@ -296,7 +296,7 @@ accum_loop: ;; Extract pk2 from pk2_am. dup1 ;; [pk2_am, pk2_am, offset, ..] - push pk2_mask ;; [mask, pk2_am, offset, ..] + push pk2_mask ;; [mask, pk2_am, pk2_am, offset, ..] and ;; [pk2, pk2_am, offset, ..] ;; Store pk2 at offset = i*RECORD_SIZE + 52. @@ -361,15 +361,15 @@ update_excess: ;; Check if excess needs to be reset to 0 for first iteration after ;; activation. - dup1 ;; [excess, excess, count, count] - push EXCESS_INHIBITOR ;; [inhibitor, excess, excess, count, count] - eq ;; [inhibitor == excess, excess, count, count] - iszero ;; [inhibitor != excess, excess, count, count] - jumpi @skip_reset ;; [excess, count, count] + dup1 ;; [excess, excess, count] + push EXCESS_INHIBITOR ;; [inhibitor, excess, excess, count] + eq ;; [inhibitor == excess, excess, count] + iszero ;; [inhibitor != excess, excess, count] + jumpi @skip_reset ;; [excess, count] - ;; Drop the excess from stack and use 0. - pop ;; [count, count] - push 0 ;; [reset_excess, count] + ;; Drop the count from stack and use 0. + pop ;; [count] + push 0 ;; [reset_excess] skip_reset: push SLOT_COUNT ;; [count_slot, excess, count] @@ -379,7 +379,7 @@ skip_reset: ;; current block is greater than the target, subtract the target from the sum ;; and set it as the new excess withdrawal requests value. push TARGET_PER_BLOCK ;; [target, count, excess, count] - dup3 ;; [excess, target, count, excess] + dup3 ;; [excess, target, count, excess, count] dup3 ;; [count, excess, target, count, excess, count] add ;; [count+excess, target, count, excess, count] gt ;; [count+excess > target, count, excess, count]