-
Notifications
You must be signed in to change notification settings - Fork 215
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
feat(staking): Log Handler #160
Conversation
beacon/staking/deposit.go
Outdated
withdrawalCredentials, | ||
) | ||
// Cache the deposit to be pushed to the queue later in batch. | ||
err = beaconState.CacheDeposit(deposit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should put the cache on the service tbh. the State() should be really simple CRUD operations
return nil | ||
} | ||
|
||
// PersistDeposits commits the cached deposits to the queue | ||
// and processes the queued deposits. | ||
func (s *BeaconStore) PersistDeposits(n uint64) ([]*Deposit, error) { | ||
func (s *BeaconStore) PersistDeposits(depositCache []*Deposit, n uint64) ([]*Deposit, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move the check from within the store to the staking service, BeaconStore / State is supposed to be dumb CRUD logic.
@itsdevbear Is it branch good to merge? I added |
…load (#160) * Update state_processor_payload.go * only pass consensus time rather than full transitionctx * rename txctx
…load (#160) * Update state_processor_payload.go * only pass consensus time rather than full transitionctx * rename txctx
…load (#160) * Update state_processor_payload.go * only pass consensus time rather than full transitionctx * rename txctx
…load (#160) * Update state_processor_payload.go * only pass consensus time rather than full transitionctx * rename txctx
…load (#160) * Update state_processor_payload.go * only pass consensus time rather than full transitionctx * rename txctx
Summary by CodeRabbit
Bug Fixes
New Features
ProcessLogs
to theBuilderService
interface for processing logs.logProcessor
field for processing logs and ast
field for staking service in theService
struct.LogProcessor
andStakingService
of theService
.ProcessLogs
in theService
struct for log processing and deposit persistence.Refactor
ProcessLogs
method to handle errors during log processing and persist deposits.Chores