anoma / namada

Rust implementation of Namada, a Proof-of-Stake L1 for interchain asset-agnostic privacy
https://namada.net
GNU General Public License v3.0
2.39k stars 945 forks source link

block epoch position #83

Closed tzemanovic closed 7 months ago

tzemanovic commented 2 years ago

Add a function to the storage to get the block epoch position of the current block. The position should start at 0 for the first block of each epoch. This will help to implement actions that should only occur once per epoch. This can be determined from the difference of the current block height and the last element of the BlockStorage's pred_epochs.first_block_heights (the latest epoch is always last in this list).

We should also add this to the WASM host env.

cwgoes commented 1 year ago

@tzemanovic do you know the status of this?

tzemanovic commented 1 year ago

@tzemanovic do you know the status of this?

still to be done

sug0 commented 7 months ago

this is already implemented. see: https://github.com/anoma/namada/blob/v0.31.2/crates/state/src/wl_storage.rs#L268-L284