Skip to content

Commit 4f97a81

Browse files
authored
Merge pull request #53 from Convex-Dev/develop
General updates
2 parents 57a6666 + a3c0e6f commit 4f97a81

File tree

31 files changed

+1612
-1968
lines changed

31 files changed

+1612
-1968
lines changed

.clj-kondo/.cache/v1/lock

Whitespace-only changes.

.lsp/.cache/db.transit.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["^ ","~:classpath",["~#set",[]],"~:project-hash","","~:project-root","C:\\Users\\mike_\\git\\design","~:kondo-config-hash","30602b3ab159ce6418abbdb9ccf57a58f69fcd1bd89e89ca1e8c53148f5f15b1","~:dependency-scheme","jar","~:analysis",null,"~:analysis-checksums",["^ "],"~:project-analysis-type","~:project-and-full-dependencies","~:version",12,"~:stubs-generation-namespaces",["^1",[]]]

components/HomepageFeatures/index.tsx

Lines changed: 0 additions & 70 deletions
This file was deleted.

components/HomepageFeatures/styles.module.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

css/custom.css

Lines changed: 0 additions & 30 deletions
This file was deleted.

custom.css

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/cad/003_encoding/README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ Applications MAY in addition use the hex digit `z` to further disambiguate code
695695

696696
### `0xD0`-`0xDF` Data Records
697697

698-
Data Records are record types where every field value is encoded (densely coded).
698+
Data Records are record types where every field value is encoded (i.e. the record is densely coded).
699699

700700
```
701701
`0xDz` <VLQ Count = n> <Continues as Vector Encoding>
@@ -705,27 +705,32 @@ Where:
705705
- n = the number of fields in the record
706706
```
707707

708-
Data Record encoding is exactly the same as a Vector, with the exception of the tag byte. Note that if there are more than 16 fields, this means there will be a child cells which are Vectors.
708+
Data Record encoding is exactly the same as a Vector, with the exception of the tag byte. Note that if there are more than 16 fields, this means there will be a child prefix cell which is a Vector.
709709

710710
Applications MAY use the hex digit `z` and/or the field count `n` to distinguish record types. If this is insufficient, applications MAY use the first or the last field value to indicate the type, or embed a Data Record as a coded value (`0xCz`) to tag with an arbitrary type.
711711

712712
The intention of Data records is that applications may interpret these as records in their own custom format. For example, a record might represent a listing on a decentralised market place with fields such as Asset ID, Price, Seller ID, Listing description, Creation Time, Time Limit etc.
713713

714+
The CVM interprets certain Data Records as CVM-specific record types (e.g. the `convex.core.cvm.State` type).
715+
714716
### `0xE0`-`0xEF` Extension Values
715717

716-
Extension values are arbitrary values allowing 16 application specific meanings.
718+
Extension values are enumeration-style values allowing 16 application specific ranges, and 2^63 possible values for each. Typically, applications might use them for encoding known enumerations, such as a reference into an array of constant values.
717719

718720
```
719-
`0xEz` <Child Value>
721+
`0xEz` <VLQ Count = value>
720722
721723
Where:
722724
- z = a hex value from 0-15
725+
- value = any non-negative Long value (0 - 2^63-1)
723726
```
724727

725-
Extension values are arbitrary values with a one byte tag, where the low byte of the tag is available for applications to define a special meaning for the value.
728+
Extension values are arbitrary non-negative integer values with a one byte tag, where the low byte of the tag is available for applications to define a special meaning for the value.
729+
730+
Extension values are considered "BlobLike" and can therefore be used a a key in an Index
726731

727732
Examples:
728-
- an application might define `0xEB` as an extension where the value is a String containing JSON data with a specific schema.
733+
- an application might define `0xE5` as an extension where the value references a known JSON schema.
729734
- another application might define `0xE0` as an enum where the values are the possible states of a finite state machine
730735

731736
### `0xFF` Illegal

docs/cad/010_transactions/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ A `Transfer` is a transaction requesting the transfer of Convex Coins from a use
3636

3737
A transfer transaction MUST specify an amount to transfer, as an integer.
3838

39-
The Source Account MUST be the origin account for the transaction, i.e. transfers can only occur from the account which has the correct digital signature
39+
The source Account MUST be the origin account for the transaction, i.e. transfers can only occur from the account which has the correct digital signature
4040

4141
Both accounts MUST be valid, otherwise the transaction MUST fail
4242

@@ -63,10 +63,10 @@ An Invoke Transaction MUST include a payload of CVM Code. This may be either:
6363

6464
High volume users MAY consider pre-compilation of CVM code to avoid additional compilation juice fees.
6565

66-
An Invoke Transaction MUST fail if:
66+
An Invoke transaction MUST fail if:
6767
- The CVM Code is not valid for execution (e.g. a syntax error in compilation)
6868
- The Origin Account has insufficient balance to pay for Juice required by the code execution
69-
- The execution of CVM Code causes any Error (e.g. a `:TRUST` Error casued by attempting an unathorised operation on an Actor)
69+
- The execution of CVM Code causes any Error (e.g. a `:TRUST` Error caused by attempting an unauthorised operation on an actor)
7070

7171
Otherwise, the CVM State MUST be updated by the result of executing the CVM Code for the Origin Account
7272

@@ -106,7 +106,7 @@ Transaction results MUST be returned in a `Result` record which contains the fol
106106
- `:id` - the message ID of the transaction to correlate with the client
107107
- `:result` - the final result of the transaction (will be the error message if an error occurred)
108108
- `:error` - the error code (MUST `nil` if no error occurred, otherwise can be any Keyword)
109-
- `:log` - a vector of log entries cerated (may be omitted if no logs events occurred)
109+
- `:log` - a vector of log entries created (may be omitted if no logs events occurred)
110110
- `:info` - a Map of information reported by the peer to the client, which SHOULD include:
111111
- `:tx` - the 32-byte SHA3-256 hash of the signed transaction
112112
- `:loc` - the location of the transaction in consensus, as a vector `[block-index transaction-index]`

docs/cad/016_peerstake/README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,39 @@ The total Stake of a seer determines its voting weight in the CPoS consensus alg
1414

1515
Stake involves taking a risk and performing useful work for the network to earn rewards.
1616

17-
A peer operator that stakes on it own peer ("peer stake") is warranting that it has **fully secured its peer key used for operational participation in consensus**. The work they do is ensuring this peer is properly managed, secured and maintains network consensus correctly. It may lose its stake if this key is compromised (typically this would mean that the peer server is itself compromised). It may also lose its stake if the controller account is compromised.
17+
A peer operator that stakes on its own peer ("peer stake") is warranting that it has **fully secured its peer key used for operational participation in consensus**. The work they do is ensuring this peer is properly managed, secured and maintains network consensus correctly. It may lose its stake if this key is compromised (typically this would mean that the peer server is itself compromised). It may also lose its stake if the controller account is compromised.
1818

1919
Delegated stakers are warranting that they **trust the peer operator to maintain consensus and earn rewards while properly protecting the peer controller account**. The work they do is in evaluating peer operators and betting their coins that the peer operators performs their role honestly and effectively. Their delegated stake is not at risk if the peer itself is compromised or crashes, but *is* at risk if the controller account is compromised.
2020

2121
It should be observed that the most important thing from a security perspective is the private key used to control the peer controller account: all stake is at risk if this is lost. For this reason it is STRONGLY RECOMMENDED that important peer controller keys are kept secure in offline storage / air-gapped systems. This is a good incentive since the network as a whole could go offline if sufficient numbers of peers are simultaneously compromised.
2222

2323
## Rewards
2424

25-
Stakers are rewarded with a share of Convex Coins earned from
25+
Stakers are rewarded with a share of Convex Coins earned from:
2626
- Transaction fees executed on the network affecting the CVM global stake
27-
- Reward Pools set by the Convex Foundation
27+
- Reward Pools build up over time set by the Convex Foundation
2828

29-
Rewards are divided as follows:
29+
### Transaction fee handling
30+
31+
Transaction fees are accumulated for all transactions executed within a complete block submitted by a peer.
32+
33+
When a block of transactions is successfully executed:
34+
- 50% are given to the peer and its stakers immediately
35+
- The remainder is added to the the common reward pool
36+
37+
### Reward pool distribution
38+
39+
Rewards are delivered from the reward pools based on peer stake and active time elapsed.
40+
41+
Active time elapsed is calculated when a block is successfully executed in consensus for a given peer. Active time is calculated as:
42+
- The difference between the timestamp of CVM state for this Block and the last such timestamp for the same peer
43+
- Subject to a maximum of 6000ms * total coin supply / total peer stake
44+
45+
i.e. if the peer's total stake is 1% of the coin supply, it must submit a block at least once every ten minutes to maintain 100% active time. This mechanism is designed to ensure that peers must participate regularly and correctly in order to obtain full rewards.
46+
47+
### Staking split
48+
49+
When rewards are given to a peer, they are divided as follows:
3050
- The total reward is divided over all Peers according to Peer Stake
3151
- For each Peer:
3252
- 50% is allocated to the Peer itself (added to peer stake)

0 commit comments

Comments
 (0)