Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-romano committed Jan 15, 2025
1 parent b1192d8 commit 2c9a547
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internal/statetransition/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ func CalculateNewCoreAuthorizations(header block.Header, guarantees block.Guaran
newAuths := make([]crypto.Hash, len(currentAuthorizations[c]))
copy(newAuths, currentAuthorizations[c])

//// TODO: For some reason test vectors don't expect this to happen, although it's on the spec.
//// TODO: [Issue 223] For some reason test vectors don't expect this to happen, although it's on the spec.
//// F(c) - Remove authorizer if it was used in a guarantee for this core. 8.3 Graypaper 0.5.4
//for _, guarantee := range guarantees.Guarantees {
// if guarantee.WorkReport.CoreIndex == c {
Expand Down Expand Up @@ -731,6 +731,8 @@ func CalculateNewCoreAuthorizations(header block.Header, guarantees block.Guaran
}

// removeAuthorizer removes an authorizer from a list while maintaining order
//
//lint:ignore U1000
func removeAuthorizer(auths []crypto.Hash, toRemove crypto.Hash) []crypto.Hash {
for i := 0; i < len(auths); i++ {
if auths[i] == toRemove {
Expand Down Expand Up @@ -1798,7 +1800,7 @@ func CalculateWorkReportsAndAccumulate(header *block.Header, currentState *state
slices.Concat(
slices.Concat(currentState.AccumulationQueue[timeslotPerEpoch:]...), // ⋃(ϑm...)
slices.Concat(currentState.AccumulationQueue[:timeslotPerEpoch]...), // ⋃(ϑ...m)
queuedWorkReports, // WQ
queuedWorkReports, // WQ
),
getWorkPackageHashes(immediatelyAccWorkReports), // P(W!)
)
Expand Down Expand Up @@ -2429,10 +2431,10 @@ func (a *Accumulator) ParallelDelta(
workReports []block.WorkReport,
privilegedGas map[block.ServiceId]uint64, // D⟨NS → NG⟩
) (
uint64, // total gas used
state.AccumulationState, // updated context
uint64, // total gas used
state.AccumulationState, // updated context
[]service.DeferredTransfer, // all transfers
ServiceHashPairs, // accumulation outputs
ServiceHashPairs, // accumulation outputs
) {
// Get all unique service indices involved (s)
// s = {rs S w ∈ w, r ∈ wr} ∪ K(f)
Expand Down Expand Up @@ -2548,7 +2550,7 @@ func (a *Accumulator) Delta1(
accumulationState state.AccumulationState,
workReports []block.WorkReport,
privilegedGas map[block.ServiceId]uint64, // D⟨NS → NG⟩
serviceIndex block.ServiceId, // NS
serviceIndex block.ServiceId, // NS
) (state.AccumulationState, []service.DeferredTransfer, *crypto.Hash, uint64) {
// Calculate gas limit (g)
gasLimit := uint64(0)
Expand Down

0 comments on commit 2c9a547

Please sign in to comment.