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

feat: downgrade perm for eth from write to read #5995

Merged
merged 2 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions venus-shared/api/chain/v1/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ type IETHEvent interface {

// Polling method for a filter, returns event logs which occurred since last poll.
// (requires write perm since timestamp of last filter execution will be written)
EthGetFilterChanges(ctx context.Context, id types.EthFilterID) (*types.EthFilterResult, error) //perm:write
EthGetFilterChanges(ctx context.Context, id types.EthFilterID) (*types.EthFilterResult, error) //perm:read

// Returns event logs matching filter with given id.
// (requires write perm since timestamp of last filter execution will be written)
EthGetFilterLogs(ctx context.Context, id types.EthFilterID) (*types.EthFilterResult, error) //perm:write
EthGetFilterLogs(ctx context.Context, id types.EthFilterID) (*types.EthFilterResult, error) //perm:read

// Installs a persistent filter based on given filter spec.
EthNewFilter(ctx context.Context, filter *types.EthFilterSpec) (types.EthFilterID, error) //perm:write
EthNewFilter(ctx context.Context, filter *types.EthFilterSpec) (types.EthFilterID, error) //perm:read

// Installs a persistent filter to notify when a new block arrives.
EthNewBlockFilter(ctx context.Context) (types.EthFilterID, error) //perm:write
EthNewBlockFilter(ctx context.Context) (types.EthFilterID, error) //perm:read

// Installs a persistent filter to notify when new messages arrive in the message pool.
EthNewPendingTransactionFilter(ctx context.Context) (types.EthFilterID, error) //perm:write
EthNewPendingTransactionFilter(ctx context.Context) (types.EthFilterID, error) //perm:read

// Uninstalls a filter with given id.
EthUninstallFilter(ctx context.Context, id types.EthFilterID) (bool, error) //perm:write
EthUninstallFilter(ctx context.Context, id types.EthFilterID) (bool, error) //perm:read

// Subscribe to different event types using websockets
// eventTypes is one or more of:
Expand All @@ -94,10 +94,10 @@ type IETHEvent interface {
// - logs: notify new event logs that match a criteria
// params contains additional parameters used with the log event type
// The client will receive a stream of EthSubscriptionResponse values until EthUnsubscribe is called.
EthSubscribe(ctx context.Context, params jsonrpc.RawParams) (types.EthSubscriptionID, error) //perm:write
EthSubscribe(ctx context.Context, params jsonrpc.RawParams) (types.EthSubscriptionID, error) //perm:read

// Unsubscribe from a websocket subscription
EthUnsubscribe(ctx context.Context, id types.EthSubscriptionID) (bool, error) //perm:write
EthUnsubscribe(ctx context.Context, id types.EthSubscriptionID) (bool, error) //perm:read
}

// reverse interface to the client, called after EthSubscribe
Expand Down
16 changes: 8 additions & 8 deletions venus-shared/api/chain/v1/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -2922,7 +2922,7 @@ Polling method for a filter, returns event logs which occurred since last poll.
(requires write perm since timestamp of last filter execution will be written)


Perms: write
Perms: read

Inputs:
```json
Expand All @@ -2943,7 +2943,7 @@ Returns event logs matching filter with given id.
(requires write perm since timestamp of last filter execution will be written)


Perms: write
Perms: read

Inputs:
```json
Expand Down Expand Up @@ -2989,7 +2989,7 @@ Response:
Installs a persistent filter to notify when a new block arrives.


Perms: write
Perms: read

Inputs: `[]`

Expand All @@ -2999,7 +2999,7 @@ Response: `"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"`
Installs a persistent filter based on given filter spec.


Perms: write
Perms: read

Inputs:
```json
Expand All @@ -3020,7 +3020,7 @@ Response: `"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"`
Installs a persistent filter to notify when new messages arrive in the message pool.


Perms: write
Perms: read

Inputs: `[]`

Expand All @@ -3036,7 +3036,7 @@ params contains additional parameters used with the log event type
The client will receive a stream of EthSubscriptionResponse values until EthUnsubscribe is called.


Perms: write
Perms: read

Inputs:
```json
Expand All @@ -3051,7 +3051,7 @@ Response: `"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"`
Uninstalls a filter with given id.


Perms: write
Perms: read

Inputs:
```json
Expand All @@ -3066,7 +3066,7 @@ Response: `true`
Unsubscribe from a websocket subscription


Perms: write
Perms: read

Inputs:
```json
Expand Down
16 changes: 8 additions & 8 deletions venus-shared/api/chain/v1/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions venus-shared/compatible-checks/api-perm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ v1: github.com/filecoin-project/venus/venus-shared/api/chain/v1 <> github.com/fi
- EthSubscriber.EthSubscription
- IETH.EthGetTransactionByHashLimited
- IETH.EthGetTransactionReceiptLimited
> IETHEvent.EthGetFilterChanges: read <> FullNode.EthGetFilterChanges: write
> IETHEvent.EthGetFilterLogs: read <> FullNode.EthGetFilterLogs: write
> IETHEvent.EthNewBlockFilter: read <> FullNode.EthNewBlockFilter: write
> IETHEvent.EthNewFilter: read <> FullNode.EthNewFilter: write
> IETHEvent.EthNewPendingTransactionFilter: read <> FullNode.EthNewPendingTransactionFilter: write
> IETHEvent.EthSubscribe: read <> FullNode.EthSubscribe: write
> IETHEvent.EthUninstallFilter: read <> FullNode.EthUninstallFilter: write
> IETHEvent.EthUnsubscribe: read <> FullNode.EthUnsubscribe: write
- IMessagePool.GasBatchEstimateMessageGas
- IMessagePool.MpoolDeleteByAdress
- IMessagePool.MpoolPublishByAddr
Expand Down