
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
fmg-nitro-adjudicator
Advanced tools
NitroAdjudicator.solConsensusApp.solThe consensus application (or consensus game) is the unique application that runs in Nitro ledger channels. Its purpose is to allow ledger channel participants to safely update how the funds in the ledger channel are distributed, by way of unanimous consensus. Recall that a ledger channel can allocate to other channels as well as the participants themselves.
The consensus application is compatible with Nitro protocol, and therefore specifies some AppAttributes to be included in each commitment as well as a validTransition function which helps the nitro-adjudicator to settle disputes.
The application specific data are organised thus:
enum UpdateType { Consensus, Proposal }
struct AppAttributes {
uint32 numVotes;
uint256[] proposedAllocation;
address[] proposedDestination;
UpdateType updateType;
}
and are in addition to (in fact a branch of) the core commitment data:
struct CommitmentStruct {
address channelType;
uint32 nonce;
address[] participants;
uint8 commitmentType;
uint32 turnNum;
uint32 numVotes;
address[] destination;
uint256[] allocation;
bytes appAttributes;
}
Valid transitions conform to the following diagram:
graph LR
linkStyle default interpolate basis
0.Consensus -->|Pass| 0.Consensus
0.Consensus -->|Propose| 1.Proposal
1.Proposal -->|Add a vote| 1.Proposal
1.Proposal -->|Propose Alternative| 1.Proposal
1.Proposal -->|New Consensus| 0.Consensus
1.Proposal -->|Veto| 0.Consensus
Note that this state machine is transitioned cyclicly by n players.
New Consensus
A1. PreFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0B2. PreFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0A3. PostFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0B4. PostFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0A5. App/Proposal; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [10]; proposedDestination: [0xChannel]; furtherVotesRequired: 1B6. App/Consensus; allocation: [10]; destination: [0xChannel]; proposedAllocation: []; proposedDestination: []; furtherVotesRequired: 0Veto
A1. PreFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0B2. PreFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0A3. PostFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0B4. PostFS; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [5,5]; proposedDestination: [0xa,0xb]; furtherVotesRequired: 0A5. App/Proposal; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: [10]; proposedDestination: [0xChannel]; furtherVotesRequired: 1B6. App/Consensus; allocation: [5,5]; destination: [0xa,0xb]; proposedAllocation: []; proposedDestination: []; furtherVotesRequired: 0New Consensus
A1. PreFS; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [5,5,5]; proposedDestination: [0xa,0xb,0xc]; furtherVotesRequired: 0B2. PreFS; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [5,5,5]; proposedDestination: [0xa,0xb,0xc]; furtherVotesRequired: 0C3. PreFS; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [5,5,5]; proposedDestination: [0xa,0xb,0xc]; furtherVotesRequired: 0A4. PostFS; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [5,5,5]; proposedDestination: [0xa,0xb,0xc]; furtherVotesRequired: 0B5. PostFS; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [5,5,5]; proposedDestination: [0xa,0xb,0xc]; furtherVotesRequired: 0C6. PostFS; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [5,5,5]; proposedDestination: [0xa,0xb,0xc]; furtherVotesRequired: 0A7. App/Proposal; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [15]; proposedDestination: [0xChannel]; furtherVotesRequired: 2B8. App/Proposal; allocation: [5,5,5]; destination: [0xa,0xb,0xc]; proposedAllocation: [15]; proposedDestination: [0xChannel]; furtherVotesRequired: 1C9. App/Consensus; allocation: [15]; destination: [0xChannel]; proposedAllocation: []; proposedDestination: []; furtherVotesRequired: 0FAQs
Unknown package
The npm package fmg-nitro-adjudicator receives a total of 30 weekly downloads. As such, fmg-nitro-adjudicator popularity was classified as not popular.
We found that fmg-nitro-adjudicator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.