Git Product home page Git Product logo

pocs's Introduction

Proof of Contract Stake (W3F Grant Project)

License Substrate version Cargo doc Build & Test

Abstract

Proof of Contract Stake (PoCS) is a staking system utilizing contract gas history introducing code-mining by incentivizing developers to secure the network. Contracts’ stake scores depend on age, reputation, and gas use, deterring collusion attacks. Further information on PoCS Protocol Design are detailed in the PoCS Research Page

Substrate Implementation

This Substrate Node is an adaptation of the substrate-stencil to integrate PoCS protocol, which includes modified pallet_contracts and pallet_staking that supports Contract Staking Feature interoperable with current Substrate NPoS-BABE-GRANDPA public node infrastructure.

Build & Run PoCS Node

  1. Clone the repository from GitHub:

    git clone https://github.com/auguth/pocs
  2. Run the Rust Setup Script

    chmod +x setup.sh && ./setup.sh
  3. Build the project in release mode:

    cargo build --release
  4. Run the executable with the specified configuration:

    ./target/release/pocs --dev
  5. Use Polkadot-JS-App and Contracts UI to interact with the Node. Refer to Testing Guide.md for extended information.

Acknowledgment

Sincere Thanks to the Web3 Foundation for their vital grant support, enabling the progress of PoCS Substrate Implementation project. For project application details, visit the PoCS W3F Grant Application

pocs's People

Contributors

jobyreuben avatar i-corinthian avatar purva-chaudhari avatar silvernberry avatar

Stargazers

Faisal avatar pichtran2004 avatar

Watchers

 avatar

pocs's Issues

Minimum Staking Requirement

The issue specified by PieWol is that minimum bond requirement is required for PoCS x NPOS for proper block time maintenance and to ensure reasonable runtime of the algorithm

The major issue with PoCS is that while bonding a contract during deployment it won't have any bond-value i.e., the stake score as it is only incremented after deployment when we make calls to the contract. This is a fundamental concept of PoCS as stake score cannot be interpreted as a token balance.

Hence, a bond-value requirement during bonding is not feasible for the design of PoCS protocol

Instead we can impose minimum staking requirements while nominating a validator and also minimum requirement for a validator to start validating. Since empty bonds without nomination doesn't comes under block production process

This minimum requirement setup is similar to other blockchain protocols which impose minimum tokens required for staking and updated every once and then according to the network's requirement and the stakable asset's price demand

The feature should implement a minimum staking requirement in form of

  • nomination requirement for bond owners
  • validation requirement for validators

This will ensure proper block time maintenance and eliminate malicious possibilities arising due to zero minimum bond

Runtime Benchmarks Failing

In the Milestone 2 Evaluation of W3F Grant, Piet | W3F have mentioned the following errors

error[E0046]: not all trait items implemented, missing: `score_update_worst_case`
	--> /root/pocs/pallets/staking/src/pallet/impls.rs:1429:1
	|
1429 | impl<T: Config> SortedListProvider<T::AccountId> for UseValidatorsMap<T> {
	| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `score_update_worst_case` in implementation
	|
	= help: implement the missing item: `fn score_update_worst_case(_: &<T as frame_system::Config>::AccountId, _: bool) -> <Self as frame_election_provider_support::SortedListProvider<<T as frame_system::Config>::AccountId>>::Score { todo!() }`

error[E0046]: not all trait items implemented, missing: `score_update_worst_case`
	--> /root/pocs/pallets/staking/src/pallet/impls.rs:1495:1
	|
1495 | impl<T: Config> SortedListProvider<T::AccountId> for UseNominatorsAndValidatorsMap<T> {
	| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `score_update_worst_case` in implementation
	|
	= help: implement the missing item: `fn score_update_worst_case(_: &<T as frame_system::Config>::AccountId, _: bool) -> <Self as frame_election_provider_support::SortedListProvider<<T as frame_system::Config>::AccountId>>::Score { todo!() }`

For more information about this error, try `rustc --explain E0046`.
warning: `pallet-staking` (lib) generated 1 warning
error: could not compile `pallet-staking` (lib) due to 2 previous errors; 1 warning emitted

This errors are found to be result of pallet-staking dependent pallets may have referenced https://github.com/paritytech/substrate.git, meanwhile pallet-staking is added locally. The solution is to find these pallets and add them locally and remove the remote reference

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.