iotexproject / iotex-core

Official implementation of IoTeX blockchain protocol in Go.
https://iotex.io
Apache License 2.0
1.55k stars 321 forks source link

persist staking protocol balance (before Greenland height) to DB in archive mode #2440

Open dustinxie opened 3 years ago

dustinxie commented 3 years ago

What version of iotex-core are you using (ioctl version)?

latest

What operating system and processor architecture are you using?

don't care

What did you do? If possible, provide a recipe for reproducing the error.

when we handle the special account io000000000000000000000000stakingprotocol (staking protocol balance), it's balance is saved in-memory, and written to DB starting at Greenland height

for rosetta client in archive mode, this caused an issue b/c it cannot query the balance at a height that is below current tip height

so in archive mode, we also need to persist the staking protocol balance at each height (after native staking activation, and before Greenland) to DB

What did you expect to see?

What did you see instead?

coderbradlee commented 3 years ago

fairbank-Greenland

coderbradlee commented 3 years ago

rosettacli test failed,because there's staking action in different height,when call api to get staking account's balance,there's error:

  1. no actual staking action in this height
  2. have staking action in this height,but tipheight still haven't write balance in this height those two errors cannot differentiate
raullenchai commented 2 years ago

What version of iotex-core are you using (ioctl version)?

latest

What operating system and processor architecture are you using?

don't care

What did you do? If possible, provide a recipe for reproducing the error.

when we handle the special account io000000000000000000000000stakingprotocol (staking protocol balance), it's balance is saved in-memory, and written to DB starting at Greenland height

for rosetta client in archive mode, this caused an issue b/c it cannot query the balance at a height that is below current tip height

so in archive mode, we also need to persist the staking protocol balance at each height (after native staking activation, and before Greenland) to DB

What did you expect to see?

What did you see instead?

@millken pls verify if this is still true