Skip to content

Commit

Permalink
Remove Deadline context for Accept, Finalize and Persist rusk grpc calls
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk-3 committed Mar 3, 2022
1 parent a8879ac commit 474a01a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/core/data/ipc/transactions/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ func (e *executor) Finalize(ctx context.Context, calls []ContractCall, stateRoot
vstr.Txs[i] = tx
}

ctx, cancel := context.WithDeadline(ctx, time.Now().Add(e.txTimeout))
defer cancel()

// No deadline grpc call. It's all or nothing. This is to avoid a scenario
// where grpc call returns DeadlineExceeded error which may end up into an
// inconsistency between rusk and dusk service states.
res, err := e.stateClient.Finalize(ctx, vstr)
if err != nil {
return nil, user.Provisioners{}, nil, err
Expand Down Expand Up @@ -212,9 +212,9 @@ func (e *executor) Accept(ctx context.Context, calls []ContractCall, stateRoot [
vstr.Txs[i] = tx
}

ctx, cancel := context.WithDeadline(ctx, time.Now().Add(e.txTimeout))
defer cancel()

// No deadline grpc call. It's all or nothing. This is to avoid a scenario
// where grpc call returns DeadlineExceeded error which may end up into an
// inconsistency between rusk and dusk service states.
res, err := e.stateClient.Accept(ctx, vstr)
if err != nil {
return nil, user.Provisioners{}, nil, err
Expand Down Expand Up @@ -343,11 +343,11 @@ func (e *executor) GetStateRoot(ctx context.Context) ([]byte, error) {

// Persist proxy call to state.Persist grpc.
func (e *executor) Persist(ctx context.Context, stateRoot []byte) error {
ctx, cancel := context.WithDeadline(ctx, time.Now().Add(e.txTimeout))
defer cancel()

req := &rusk.PersistRequest{StateRoot: stateRoot}

// No deadline grpc call. It's all or nothing. This is to avoid a scenario
// where grpc call returns DeadlineExceeded error which may end up into an
// inconsistency between rusk and dusk service states.
_, err := e.stateClient.Persist(ctx, req)
if err != nil {
return err
Expand Down

0 comments on commit 474a01a

Please sign in to comment.