Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add a reputation system #645

Merged
merged 5 commits into from
Sep 4, 2018
Merged

Add a reputation system #645

merged 5 commits into from
Sep 4, 2018

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Sep 1, 2018

Close #370
Close #412

Implements the changes described by #370 and #412.

One small difference is that we don't immediately try to connect to peers when it would be necessary (as #412 says). Instead there is a cycle of 1 second where we check for connections that need to be opened. This is because it was much easier to implement, and I don't think it makes much of a difference in practice.

After this change, my local node (unreachable from the outside) alternates between 6 and 21 peers. Once #540 is fixed, the number of peers should be pretty high very quickly and constantly.

When it comes to the code, the one notable difference now is that a node index is assigned whenever a connection is opened, and this index is then passed around. This contrasts with the previous code where we identify a connection by the multiaddress of the remote.
The small consequence is that, since we now need to know the public key of the remote as soon as it connects, it makes encryption mandatory.
Since we no longer identify the remote when we connect, the cycle where we ping is also used to identify nodes which we haven't identified yet.

@tomaka tomaka added A0-please_review Pull request needs code review. M4-core labels Sep 1, 2018
@tomaka tomaka added the A1-onice label Sep 1, 2018
@tomaka
Copy link
Contributor Author

tomaka commented Sep 1, 2018

This PR is good for review, but I think #540 should be fixed before merging because it triggers way more often with this PR.

@tomaka tomaka removed the A1-onice label Sep 3, 2018
@gavofyork gavofyork added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 3, 2018
@gavofyork gavofyork merged commit e3a70fe into paritytech:master Sep 4, 2018
@tomaka tomaka deleted the topology branch September 4, 2018 07:12
gavofyork pushed a commit that referenced this pull request Sep 4, 2018
* Add a reputation system

* Fix tests

* Don't try to dial peers to which we are already connected

* Use the master branch of libp2p
dvdplm added a commit that referenced this pull request Sep 4, 2018
* master: (22 commits)
  Introduce treasury and document (#646)
  Off-the-table staking preference (#656)
  Implement function `json_metadata` in `decl_module!` (#654)
  Fix warnings in networking (#652)
  Add a reputation system (#645)
  Check for pruned block state (#648)
  Contract runtime polishing (#601)
  WIP on chain heap (#639)
  Events to track extrinsic success (#640)
  Install llvm-tools-preview component (#643)
  fix wasm executor compile error (#631)
  random fixes (#638)
  Empty becomes (), reflecting convention (#637)
  Allow to build_upon skipped entries, but don't walk back (#635)
  Separate out staking module into balances and payment (#629)
  Update .gitlab-ci.yml (#633)
  Do not attempt to rustup if in CI. This is taken care of by the base (#621)
  Avoid need for ident strings in storage (#624)
  rename to panic_handler as panic_implementation is deprecated in nightly (#626)
  5 random fixes (#2) (#623)
  ...
dvdplm added a commit that referenced this pull request Sep 5, 2018
…and-rlpcodec

* master:
  Upgrade to libp2p master (#660)
  Include function comments into modules `json_metadata` (#657)
  Replace old headers with CHT in light clients (#512)
  Fix build
  Introduce treasury and document (#646)
  Off-the-table staking preference (#656)
  Implement function `json_metadata` in `decl_module!` (#654)
  Fix warnings in networking (#652)
  Add a reputation system (#645)
  Check for pruned block state (#648)
lamafab pushed a commit to lamafab/substrate that referenced this pull request Jun 16, 2020
liuchengxu pushed a commit to chainx-org/substrate that referenced this pull request Aug 23, 2021
* fix bug for withdrawal check

1.  not allow the withdraw addr is cold/hot addr
2. support withdrawal fee check in fee.rs
3. change lock time for reversed time in genesis
4. change rpc total_confirm to totalConfirm

* change return err msg
helin6 pushed a commit to boolnetwork/substrate that referenced this pull request Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework peer connections Basic, persistent reputation system
2 participants