Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postage batch store #922

Closed
wants to merge 3 commits into from
Closed

postage batch store #922

wants to merge 3 commits into from

Conversation

zelig
Copy link
Member

@zelig zelig commented Nov 7, 2020

deprecated by #1046. - based on AP #928 https://hackmd.io/o8RGsNwZSN6IE0lkBAZCPw

@zelig zelig self-assigned this Nov 7, 2020
@zelig zelig force-pushed the batch-store branch 3 times, most recently from 7e9a8c8 to 62c2a5c Compare November 9, 2020 14:31
Base automatically changed from stamper to storage-incentives November 12, 2020 05:27
@acud acud force-pushed the storage-incentives branch 2 times, most recently from 134fa9a to cbd4d4a Compare December 7, 2020 15:55
func (s *Store) settle(block uint64) {
period := int64(block - s.state.block)
s.state.block = block
s.state.total.Add(s.state.total, new(big.Int).Mul(s.state.price, big.NewInt(period)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this reintroduces a lot of the reorg issues we wanted to get rid of. instead of doing this price update thing here we should refetch this value using the totalOutPayment getter when there is a PriceUpdate event on the oracle contract.

if err != nil {
return err
}
b.Depth = depth
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the unit of balance? is this total amount paid into it, or per chunk (like the normalised balance). If the latter, changing the depth also changes the balance.

Copy link
Member Author

@zelig zelig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • mutex should be used
  • replace to be ised when changing value (topup/depth change)
  • entrypoint for latest state
  • entrypoint for Get by batch id

return err
}
err = s.replace(id, b.Value, value)
value, err := s.balance(b, value)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value can cime durectly from the event]

err = s.replace(id, b.Value, value)

panic("@zelig - should we have b.Add(value)?")
value, err := s.balance(b, value)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value can cime durectly from the event]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need the relace call bothg in topup and increasedepth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants