Skip to content

Commit

Permalink
[move/rewards] Add proposer stats to onchain performance (aptos-labs#…
Browse files Browse the repository at this point in the history
…2507)

* Add proposer stats to onchain performance

* Change validator rewards to proposal-based rewards
  • Loading branch information
igor-aptos authored Aug 5, 2022
1 parent 36a7c00 commit 76b654b
Show file tree
Hide file tree
Showing 33 changed files with 399 additions and 302 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@
{
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"0"
],
"num_blocks": "0"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "0"
}
]
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"1"
],
"num_blocks": "1"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "1"
}
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"13"
],
"num_blocks": "13"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "13"
}
]
}
}
},
Expand Down Expand Up @@ -410,10 +412,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"14"
],
"num_blocks": "14"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "14"
}
]
}
}
},
Expand Down Expand Up @@ -639,10 +643,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"15"
],
"num_blocks": "15"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "15"
}
]
}
}
},
Expand Down Expand Up @@ -868,10 +874,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"16"
],
"num_blocks": "16"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "16"
}
]
}
}
},
Expand Down Expand Up @@ -1097,10 +1105,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"17"
],
"num_blocks": "17"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "17"
}
]
}
}
},
Expand Down Expand Up @@ -1326,10 +1336,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"18"
],
"num_blocks": "18"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "18"
}
]
}
}
},
Expand Down Expand Up @@ -1555,10 +1567,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"19"
],
"num_blocks": "19"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "19"
}
]
}
}
},
Expand Down Expand Up @@ -1784,10 +1798,12 @@
"data": {
"type": "0x1::stake::ValidatorPerformance",
"data": {
"missed_votes": [
"20"
],
"num_blocks": "20"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "20"
}
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"0"
],
"num_blocks": "0"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "0"
}
]
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"1"
],
"num_blocks": "1"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "1"
}
]
}
},
"type": "write_resource"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"13"
],
"num_blocks": "13"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "13"
}
]
}
},
"type": "write_resource"
Expand Down Expand Up @@ -489,10 +491,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"14"
],
"num_blocks": "14"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "14"
}
]
}
},
"type": "write_resource"
Expand Down Expand Up @@ -761,10 +765,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"15"
],
"num_blocks": "15"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "15"
}
]
}
},
"type": "write_resource"
Expand Down Expand Up @@ -1033,10 +1039,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"16"
],
"num_blocks": "16"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "16"
}
]
}
},
"type": "write_resource"
Expand Down Expand Up @@ -1305,10 +1313,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"17"
],
"num_blocks": "17"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "17"
}
]
}
},
"type": "write_resource"
Expand Down Expand Up @@ -1577,10 +1587,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"18"
],
"num_blocks": "18"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "18"
}
]
}
},
"type": "write_resource"
Expand Down Expand Up @@ -1849,10 +1861,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"19"
],
"num_blocks": "19"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "19"
}
]
}
},
"type": "write_resource"
Expand Down Expand Up @@ -2121,10 +2135,12 @@
"generic_type_params": []
},
"data": {
"missed_votes": [
"20"
],
"num_blocks": "20"
"validators": [
{
"failed_proposals": "0",
"successful_proposals": "20"
}
]
}
},
"type": "write_resource"
Expand Down
3 changes: 2 additions & 1 deletion api/src/tests/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,9 @@ impl TestContext {
id,
0,
round,
vec![false],
self.validator_owner,
Some(0),
vec![false],
vec![],
timestamp,
)
Expand Down
3 changes: 2 additions & 1 deletion aptos-move/aptos-transaction-benchmarks/src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ impl TransactionBenchState {
HashValue::zero(),
0,
0,
validator_set.payload().map(|_| false).collect(),
*validator_set.payload().next().unwrap().account_address(),
Some(0),
validator_set.payload().map(|_| false).collect(),
vec![],
1,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,9 @@ impl<'a> MoveTestAdapter<'a> for AptosTestAdapter<'a> {
HashValue::zero(),
0,
block_cmd.time,
vec![],
proposer,
Some(0),
vec![],
vec![],
block_cmd.time,
);
Expand Down
Loading

0 comments on commit 76b654b

Please sign in to comment.