iotexproject / iotexproject/iotex-core

Validate Signature at p2p level with validator

Open
#4,546 0 comments 0 reactions 1 assignee Claimed by @envestcc View on GitHub
feature
Dominant language
Go
Stars
1.6k
Forks
382
Avg merge
4d 22h
Merged PRs (30d)
17

Description

For an incoming msg with type iotextypes.Action, the validation of signature should be done once receiving the msg at the p2p level. If the signature is invalid, ignore this message. With this validator, we can skip signature validation for all messages which are not ignored. Similar validations could be applied to block.Block and other message types which contains signature.

Besides that, we can add a rate limit in the validator to limit the number of messages a sender could send in a period.

Related code:
- https://github.com/libp2p/go-libp2p-pubsub/blob/master/pubsub.go#L1399
- https://github.com/iotexproject/go-p2p/blob/master/p2p.go#L400

### Is this a hard-fork (and height to be activated)
- [] Yes
- Name of activation height:

### Implementation plan
- [] Phase 1 description (PR number)
- [] Phase 2 description (PR number)
- [] Phase 3 description (PR number)

### Affected modules
- [] action
- [] actpool
- [] api
- [] blockchain
- [] blockindex
- [] blocksync
- [] chainservice
- [] config
- [] consensus
- [] db
- [x] dispatcher
- [] ioctl
- [x] p2p
- [] server
- [] state
- [] tools

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.