Skip to content

Commit

Permalink
fix: deprecate three functions
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Jun 22, 2022
1 parent 947b560 commit 5736197
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
3 changes: 3 additions & 0 deletions app/submodule/chain/chaininfo_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ func (cia *chainInfoAPI) VerifyEntry(parent, child *types.BeaconEntry, height ab
// BeaconGetEntry returns the beacon entry for the given filecoin epoch. If
// the entry has not yet been produced, the call will block until the entry
// becomes available
// Deprecated: Use StateGetBeaconEntry instead.
func (cia *chainInfoAPI) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) {
return cia.StateGetBeaconEntry(ctx, epoch)
}
Expand Down Expand Up @@ -385,11 +386,13 @@ func (cia *chainInfoAPI) getNetworkName(ctx context.Context) (string, error) {
}

// ChainGetRandomnessFromBeacon is used to sample the beacon for randomness.
// Deprecated: Use StateGetRandomnessFromBeacon instead.
func (cia *chainInfoAPI) ChainGetRandomnessFromBeacon(ctx context.Context, key types.TipSetKey, personalization acrypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) {
return cia.StateGetRandomnessFromBeacon(ctx, personalization, randEpoch, entropy, key)
}

// ChainGetRandomnessFromTickets is used to sample the chain for randomness.
// Deprecated: Use StateGetRandomnessFromTickets instead.
func (cia *chainInfoAPI) ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization acrypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) {
return cia.StateGetRandomnessFromTickets(ctx, personalization, randEpoch, entropy, tsk)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/messagepool/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (mp *MessagePool) evalMessageGasLimit(ctx context.Context, msgIn *types.Mes

// skip storage market, 80th percentie for everything ~1.9, leave it at 2.0
}()
log.Infof("overestimate gas around the upgrade %v", transitionalMulti)
log.Infof("overestimate gas around the upgrade msg: %v, transitional multi: %v", msg, transitionalMulti)
}
ret = (ret * int64(transitionalMulti*1024)) >> 10

Expand Down
6 changes: 3 additions & 3 deletions tools/conformance/rand_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func (r *RecordingRand) GetChainRandomnessV1(ctx context.Context, pers crypto.Do

func (r *RecordingRand) getChainRandomness(ctx context.Context, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error) {
r.once.Do(r.loadHead)
// FullNode's ChainGetRandomnessFromTickets handles whether we should be looking forward or back
ret, err := r.api.ChainGetRandomnessFromTickets(ctx, r.head, pers, round, entropy)
// FullNode's StateGetRandomnessFromTickets handles whether we should be looking forward or back
ret, err := r.api.StateGetRandomnessFromTickets(ctx, pers, round, entropy, r.head)
if err != nil {
return ret, err
}
Expand Down Expand Up @@ -100,7 +100,7 @@ func (r *RecordingRand) GetBeaconRandomnessV2(ctx context.Context, pers crypto.D

func (r *RecordingRand) getBeaconRandomness(ctx context.Context, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error) {
r.once.Do(r.loadHead)
ret, err := r.api.ChainGetRandomnessFromBeacon(ctx, r.head, pers, round, entropy)
ret, err := r.api.StateGetRandomnessFromBeacon(ctx, pers, round, entropy, r.head)
if err != nil {
return ret, err
}
Expand Down
19 changes: 11 additions & 8 deletions venus-shared/api/chain/v1/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,21 @@ type IActor interface {
}

type IBeacon interface {
// Deprecated: Use StateGetBeaconEntry instead.
BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read
}

type IChainInfo interface {
BlockTime(ctx context.Context) time.Duration //perm:read
ChainList(ctx context.Context, tsKey types.TipSetKey, count int) ([]types.TipSetKey, error) //perm:read
ChainHead(ctx context.Context) (*types.TipSet, error) //perm:read
ChainSetHead(ctx context.Context, key types.TipSetKey) error //perm:admin
ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) //perm:read
ChainGetTipSetByHeight(ctx context.Context, height abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) //perm:read
ChainGetTipSetAfterHeight(ctx context.Context, height abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) //perm:read
ChainGetRandomnessFromBeacon(ctx context.Context, key types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
BlockTime(ctx context.Context) time.Duration //perm:read
ChainList(ctx context.Context, tsKey types.TipSetKey, count int) ([]types.TipSetKey, error) //perm:read
ChainHead(ctx context.Context) (*types.TipSet, error) //perm:read
ChainSetHead(ctx context.Context, key types.TipSetKey) error //perm:admin
ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) //perm:read
ChainGetTipSetByHeight(ctx context.Context, height abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) //perm:read
ChainGetTipSetAfterHeight(ctx context.Context, height abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) //perm:read
// Deprecated: Use StateGetRandomnessFromBeacon instead.
ChainGetRandomnessFromBeacon(ctx context.Context, key types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
// Deprecated: Use StateGetRandomnessFromTickets instead.
ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
Expand Down
3 changes: 3 additions & 0 deletions venus-shared/api/chain/v1/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ Response:
## Beacon

### BeaconGetEntry
Deprecated: Use StateGetBeaconEntry instead.


Perms: read
Expand Down Expand Up @@ -704,6 +705,7 @@ Response:
```

### ChainGetRandomnessFromBeacon
Deprecated: Use StateGetRandomnessFromBeacon instead.


Perms: read
Expand All @@ -728,6 +730,7 @@ Inputs:
Response: `"Bw=="`

### ChainGetRandomnessFromTickets
Deprecated: Use StateGetRandomnessFromTickets instead.


Perms: read
Expand Down

0 comments on commit 5736197

Please sign in to comment.