diff --git a/aleph-client/src/aleph_zero.rs b/aleph-client/src/aleph_zero.rs index a3003cf95e..cb73e8175d 100644 --- a/aleph-client/src/aleph_zero.rs +++ b/aleph-client/src/aleph_zero.rs @@ -1224,10 +1224,10 @@ pub mod api { "submit_abft_score", types::SubmitAbftScore { score, signature }, [ - 140u8, 93u8, 130u8, 205u8, 26u8, 91u8, 15u8, 42u8, 114u8, 53u8, 228u8, - 197u8, 231u8, 224u8, 63u8, 33u8, 244u8, 230u8, 47u8, 139u8, 127u8, - 145u8, 125u8, 127u8, 28u8, 177u8, 132u8, 104u8, 99u8, 65u8, 170u8, - 49u8, + 2u8, 222u8, 25u8, 52u8, 171u8, 188u8, 243u8, 151u8, 79u8, 219u8, 153u8, + 246u8, 149u8, 159u8, 214u8, 78u8, 247u8, 43u8, 107u8, 218u8, 223u8, + 42u8, 58u8, 172u8, 75u8, 223u8, 149u8, 178u8, 201u8, 140u8, 63u8, + 108u8, ], ) } @@ -1679,9 +1679,10 @@ pub mod api { input_data, }, [ - 249u8, 196u8, 50u8, 40u8, 89u8, 99u8, 103u8, 72u8, 161u8, 171u8, 87u8, - 220u8, 18u8, 116u8, 106u8, 64u8, 221u8, 33u8, 201u8, 90u8, 32u8, 100u8, - 155u8, 21u8, 250u8, 140u8, 200u8, 55u8, 202u8, 66u8, 59u8, 173u8, + 254u8, 77u8, 172u8, 241u8, 229u8, 242u8, 214u8, 150u8, 191u8, 23u8, + 65u8, 131u8, 250u8, 201u8, 161u8, 26u8, 7u8, 239u8, 218u8, 46u8, 93u8, + 38u8, 55u8, 154u8, 198u8, 77u8, 153u8, 188u8, 203u8, 140u8, 73u8, + 201u8, ], ) } @@ -1726,9 +1727,10 @@ pub mod api { salt, }, [ - 32u8, 175u8, 86u8, 189u8, 80u8, 196u8, 85u8, 80u8, 123u8, 200u8, 209u8, - 186u8, 176u8, 105u8, 29u8, 74u8, 109u8, 113u8, 30u8, 68u8, 10u8, 103u8, - 72u8, 212u8, 240u8, 122u8, 153u8, 146u8, 141u8, 208u8, 243u8, 120u8, + 69u8, 154u8, 136u8, 237u8, 1u8, 69u8, 76u8, 135u8, 54u8, 202u8, 178u8, + 188u8, 202u8, 135u8, 109u8, 161u8, 149u8, 229u8, 69u8, 190u8, 169u8, + 200u8, 121u8, 127u8, 117u8, 190u8, 59u8, 20u8, 207u8, 37u8, 236u8, + 103u8, ], ) } @@ -2180,9 +2182,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 228u8, 34u8, 101u8, 227u8, 179u8, 132u8, 141u8, 106u8, 88u8, 199u8, 195u8, 76u8, - 251u8, 107u8, 160u8, 98u8, 213u8, 40u8, 192u8, 33u8, 218u8, 72u8, 8u8, 42u8, 40u8, - 135u8, 252u8, 58u8, 28u8, 216u8, 156u8, 108u8, + 181u8, 58u8, 203u8, 79u8, 62u8, 47u8, 91u8, 201u8, 90u8, 151u8, 65u8, 10u8, 7u8, + 43u8, 151u8, 98u8, 47u8, 70u8, 191u8, 228u8, 11u8, 90u8, 230u8, 47u8, 159u8, 15u8, + 195u8, 212u8, 89u8, 77u8, 211u8, 66u8, ] } pub mod system { @@ -3072,10 +3074,9 @@ pub mod api { "Events", vec![], [ - 115u8, 238u8, 35u8, 45u8, 198u8, 110u8, 196u8, 57u8, 242u8, 194u8, - 251u8, 195u8, 94u8, 112u8, 244u8, 29u8, 151u8, 120u8, 211u8, 5u8, - 183u8, 127u8, 246u8, 75u8, 183u8, 111u8, 72u8, 51u8, 45u8, 95u8, 109u8, - 140u8, + 172u8, 44u8, 151u8, 186u8, 250u8, 111u8, 8u8, 185u8, 103u8, 45u8, 8u8, + 18u8, 88u8, 40u8, 30u8, 177u8, 73u8, 229u8, 87u8, 11u8, 139u8, 237u8, + 145u8, 249u8, 161u8, 129u8, 20u8, 208u8, 83u8, 227u8, 221u8, 17u8, ], ) } @@ -3582,9 +3583,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 175u8, 19u8, 236u8, 154u8, 204u8, 172u8, 221u8, 53u8, 124u8, 52u8, - 245u8, 4u8, 70u8, 142u8, 111u8, 202u8, 234u8, 68u8, 121u8, 142u8, 84u8, - 63u8, 77u8, 172u8, 181u8, 66u8, 249u8, 157u8, 122u8, 0u8, 200u8, 63u8, + 47u8, 142u8, 12u8, 14u8, 161u8, 109u8, 77u8, 109u8, 224u8, 171u8, + 204u8, 107u8, 189u8, 230u8, 55u8, 201u8, 192u8, 198u8, 11u8, 43u8, + 57u8, 85u8, 33u8, 243u8, 180u8, 90u8, 176u8, 251u8, 202u8, 192u8, + 115u8, 113u8, ], ) } @@ -3629,10 +3631,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 100u8, 199u8, 242u8, 90u8, 197u8, 22u8, 71u8, 228u8, 32u8, 164u8, - 227u8, 135u8, 64u8, 26u8, 166u8, 221u8, 35u8, 216u8, 149u8, 57u8, - 119u8, 199u8, 84u8, 172u8, 75u8, 181u8, 234u8, 65u8, 236u8, 71u8, - 221u8, 61u8, + 67u8, 162u8, 135u8, 158u8, 123u8, 161u8, 99u8, 130u8, 138u8, 43u8, + 83u8, 229u8, 108u8, 229u8, 184u8, 41u8, 223u8, 87u8, 69u8, 26u8, 91u8, + 53u8, 79u8, 240u8, 101u8, 5u8, 206u8, 11u8, 8u8, 217u8, 103u8, 199u8, ], ) } @@ -3673,10 +3674,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 249u8, 182u8, 147u8, 25u8, 30u8, 103u8, 139u8, 83u8, 46u8, 147u8, 12u8, - 93u8, 225u8, 91u8, 254u8, 238u8, 229u8, 120u8, 166u8, 121u8, 228u8, - 130u8, 218u8, 23u8, 238u8, 228u8, 165u8, 17u8, 238u8, 182u8, 159u8, - 73u8, + 112u8, 60u8, 79u8, 132u8, 208u8, 202u8, 103u8, 82u8, 116u8, 214u8, + 79u8, 194u8, 141u8, 36u8, 79u8, 49u8, 118u8, 14u8, 220u8, 160u8, 87u8, + 198u8, 228u8, 76u8, 16u8, 183u8, 57u8, 149u8, 188u8, 19u8, 114u8, 38u8, ], ) } @@ -3703,10 +3703,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 247u8, 8u8, 186u8, 231u8, 128u8, 193u8, 165u8, 209u8, 61u8, 234u8, - 153u8, 248u8, 15u8, 118u8, 100u8, 136u8, 95u8, 254u8, 164u8, 24u8, - 195u8, 46u8, 137u8, 156u8, 146u8, 202u8, 106u8, 235u8, 224u8, 141u8, - 138u8, 50u8, + 19u8, 190u8, 41u8, 12u8, 147u8, 120u8, 83u8, 238u8, 208u8, 45u8, 117u8, + 109u8, 165u8, 12u8, 108u8, 192u8, 31u8, 40u8, 44u8, 202u8, 87u8, 238u8, + 95u8, 86u8, 230u8, 107u8, 166u8, 55u8, 145u8, 212u8, 31u8, 193u8, ], ) } @@ -9559,9 +9558,9 @@ pub mod api { "unsigned_submit_abft_score", types::UnsignedSubmitAbftScore { score, signature }, [ - 149u8, 135u8, 162u8, 2u8, 161u8, 78u8, 158u8, 8u8, 139u8, 206u8, 234u8, - 227u8, 54u8, 92u8, 55u8, 189u8, 24u8, 9u8, 192u8, 155u8, 73u8, 105u8, - 254u8, 100u8, 95u8, 146u8, 152u8, 55u8, 71u8, 121u8, 56u8, 14u8, + 5u8, 88u8, 75u8, 237u8, 209u8, 39u8, 22u8, 221u8, 92u8, 99u8, 67u8, + 64u8, 192u8, 47u8, 124u8, 110u8, 2u8, 59u8, 243u8, 32u8, 98u8, 101u8, + 14u8, 180u8, 38u8, 193u8, 119u8, 96u8, 123u8, 94u8, 115u8, 62u8, ], ) } @@ -9880,10 +9879,9 @@ pub mod api { _0.borrow(), )], [ - 61u8, 84u8, 105u8, 208u8, 230u8, 198u8, 161u8, 36u8, 58u8, 245u8, - 209u8, 88u8, 181u8, 129u8, 209u8, 232u8, 104u8, 24u8, 251u8, 228u8, - 160u8, 196u8, 47u8, 202u8, 243u8, 83u8, 96u8, 225u8, 8u8, 125u8, 201u8, - 168u8, + 150u8, 237u8, 116u8, 146u8, 6u8, 142u8, 58u8, 219u8, 81u8, 187u8, + 158u8, 62u8, 144u8, 52u8, 6u8, 130u8, 220u8, 70u8, 210u8, 64u8, 130u8, + 40u8, 76u8, 134u8, 32u8, 253u8, 9u8, 135u8, 75u8, 122u8, 153u8, 130u8, ], ) } @@ -9901,10 +9899,9 @@ pub mod api { "AbftScores", Vec::new(), [ - 61u8, 84u8, 105u8, 208u8, 230u8, 198u8, 161u8, 36u8, 58u8, 245u8, - 209u8, 88u8, 181u8, 129u8, 209u8, 232u8, 104u8, 24u8, 251u8, 228u8, - 160u8, 196u8, 47u8, 202u8, 243u8, 83u8, 96u8, 225u8, 8u8, 125u8, 201u8, - 168u8, + 150u8, 237u8, 116u8, 146u8, 6u8, 142u8, 58u8, 219u8, 81u8, 187u8, + 158u8, 62u8, 144u8, 52u8, 6u8, 130u8, 220u8, 70u8, 210u8, 64u8, 130u8, + 40u8, 76u8, 134u8, 32u8, 253u8, 9u8, 135u8, 75u8, 122u8, 153u8, 130u8, ], ) } @@ -11885,9 +11882,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 16u8, 206u8, 12u8, 166u8, 102u8, 18u8, 58u8, 45u8, 3u8, 92u8, 169u8, - 248u8, 131u8, 87u8, 167u8, 134u8, 52u8, 186u8, 35u8, 204u8, 246u8, - 58u8, 217u8, 22u8, 47u8, 182u8, 117u8, 245u8, 59u8, 202u8, 68u8, 136u8, + 21u8, 233u8, 23u8, 212u8, 12u8, 19u8, 57u8, 116u8, 44u8, 192u8, 127u8, + 123u8, 104u8, 188u8, 53u8, 21u8, 186u8, 181u8, 52u8, 63u8, 8u8, 196u8, + 245u8, 49u8, 94u8, 225u8, 98u8, 49u8, 60u8, 51u8, 123u8, 89u8, ], ) } @@ -11905,9 +11902,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 82u8, 173u8, 225u8, 130u8, 157u8, 164u8, 124u8, 99u8, 43u8, 185u8, - 214u8, 179u8, 187u8, 230u8, 81u8, 81u8, 84u8, 71u8, 132u8, 130u8, 55u8, - 70u8, 156u8, 169u8, 119u8, 60u8, 146u8, 47u8, 1u8, 253u8, 213u8, 118u8, + 48u8, 36u8, 218u8, 239u8, 129u8, 221u8, 18u8, 3u8, 148u8, 10u8, 235u8, + 94u8, 59u8, 229u8, 219u8, 163u8, 159u8, 20u8, 9u8, 85u8, 239u8, 127u8, + 162u8, 221u8, 161u8, 218u8, 161u8, 147u8, 66u8, 141u8, 49u8, 148u8, ], ) } @@ -11921,9 +11918,10 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 61u8, 181u8, 121u8, 188u8, 160u8, 167u8, 141u8, 88u8, 225u8, 71u8, - 182u8, 75u8, 174u8, 85u8, 81u8, 208u8, 13u8, 53u8, 180u8, 50u8, 235u8, - 53u8, 221u8, 172u8, 148u8, 47u8, 21u8, 157u8, 107u8, 100u8, 5u8, 43u8, + 175u8, 109u8, 242u8, 180u8, 115u8, 40u8, 141u8, 141u8, 197u8, 226u8, + 73u8, 246u8, 183u8, 94u8, 224u8, 217u8, 56u8, 177u8, 196u8, 98u8, 14u8, + 140u8, 170u8, 234u8, 120u8, 180u8, 238u8, 12u8, 47u8, 251u8, 107u8, + 190u8, ], ) } @@ -11941,9 +11939,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 43u8, 44u8, 207u8, 245u8, 75u8, 163u8, 249u8, 121u8, 115u8, 11u8, - 155u8, 239u8, 129u8, 44u8, 175u8, 230u8, 88u8, 35u8, 67u8, 31u8, 141u8, - 1u8, 90u8, 153u8, 110u8, 114u8, 102u8, 212u8, 102u8, 9u8, 37u8, 101u8, + 244u8, 32u8, 79u8, 82u8, 14u8, 246u8, 111u8, 243u8, 226u8, 136u8, 72u8, + 14u8, 90u8, 212u8, 143u8, 206u8, 153u8, 25u8, 68u8, 204u8, 136u8, 77u8, + 55u8, 5u8, 54u8, 5u8, 179u8, 58u8, 50u8, 68u8, 0u8, 123u8, ], ) } @@ -11957,10 +11955,10 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 178u8, 77u8, 105u8, 165u8, 160u8, 167u8, 105u8, 165u8, 154u8, 104u8, - 86u8, 177u8, 186u8, 187u8, 233u8, 245u8, 226u8, 238u8, 103u8, 221u8, - 196u8, 33u8, 60u8, 27u8, 92u8, 147u8, 82u8, 184u8, 47u8, 121u8, 253u8, - 253u8, + 84u8, 103u8, 45u8, 110u8, 132u8, 99u8, 121u8, 98u8, 73u8, 167u8, 193u8, + 251u8, 239u8, 191u8, 134u8, 147u8, 129u8, 212u8, 100u8, 126u8, 53u8, + 88u8, 154u8, 144u8, 114u8, 121u8, 234u8, 237u8, 12u8, 30u8, 111u8, + 248u8, ], ) } @@ -11978,9 +11976,9 @@ pub mod api { weight, }, [ - 230u8, 121u8, 80u8, 134u8, 106u8, 15u8, 229u8, 148u8, 141u8, 41u8, - 108u8, 213u8, 29u8, 86u8, 193u8, 65u8, 67u8, 80u8, 210u8, 14u8, 208u8, - 103u8, 26u8, 54u8, 54u8, 88u8, 198u8, 194u8, 83u8, 68u8, 171u8, 193u8, + 211u8, 159u8, 38u8, 134u8, 149u8, 48u8, 68u8, 109u8, 35u8, 10u8, 13u8, + 222u8, 171u8, 58u8, 75u8, 224u8, 207u8, 23u8, 45u8, 215u8, 203u8, 0u8, + 55u8, 242u8, 92u8, 157u8, 229u8, 194u8, 118u8, 86u8, 246u8, 136u8, ], ) } @@ -12270,10 +12268,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 206u8, 21u8, 156u8, 172u8, 255u8, 225u8, 115u8, 19u8, 129u8, 176u8, - 196u8, 170u8, 213u8, 125u8, 66u8, 235u8, 194u8, 178u8, 4u8, 182u8, - 228u8, 99u8, 217u8, 236u8, 78u8, 204u8, 127u8, 180u8, 212u8, 49u8, - 182u8, 243u8, + 237u8, 247u8, 238u8, 0u8, 135u8, 248u8, 119u8, 84u8, 169u8, 100u8, + 47u8, 10u8, 199u8, 71u8, 58u8, 177u8, 2u8, 42u8, 213u8, 223u8, 106u8, + 54u8, 168u8, 246u8, 206u8, 76u8, 249u8, 172u8, 199u8, 125u8, 147u8, + 221u8, ], ) } @@ -12301,10 +12299,9 @@ pub mod api { max_weight, }, [ - 7u8, 246u8, 44u8, 204u8, 101u8, 178u8, 78u8, 191u8, 14u8, 55u8, 5u8, - 158u8, 159u8, 165u8, 39u8, 225u8, 68u8, 103u8, 160u8, 115u8, 6u8, - 143u8, 250u8, 204u8, 185u8, 14u8, 173u8, 43u8, 114u8, 176u8, 246u8, - 33u8, + 94u8, 29u8, 48u8, 232u8, 125u8, 100u8, 182u8, 113u8, 244u8, 116u8, + 43u8, 236u8, 46u8, 161u8, 131u8, 205u8, 78u8, 36u8, 112u8, 80u8, 153u8, + 128u8, 2u8, 169u8, 197u8, 153u8, 42u8, 26u8, 207u8, 55u8, 79u8, 75u8, ], ) } @@ -12717,10 +12714,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 158u8, 236u8, 76u8, 233u8, 168u8, 113u8, 30u8, 185u8, 196u8, 114u8, - 248u8, 203u8, 241u8, 127u8, 201u8, 211u8, 211u8, 136u8, 214u8, 37u8, - 51u8, 244u8, 224u8, 69u8, 154u8, 242u8, 186u8, 79u8, 25u8, 180u8, - 108u8, 106u8, + 199u8, 204u8, 98u8, 214u8, 44u8, 34u8, 68u8, 159u8, 18u8, 130u8, 193u8, + 214u8, 104u8, 23u8, 138u8, 96u8, 244u8, 191u8, 63u8, 95u8, 83u8, 1u8, + 167u8, 240u8, 18u8, 4u8, 182u8, 17u8, 120u8, 236u8, 21u8, 31u8, ], ) } @@ -12738,9 +12734,9 @@ pub mod api { weight, }, [ - 66u8, 188u8, 22u8, 180u8, 173u8, 195u8, 224u8, 159u8, 66u8, 48u8, - 243u8, 79u8, 146u8, 18u8, 230u8, 125u8, 10u8, 99u8, 4u8, 46u8, 97u8, - 16u8, 27u8, 118u8, 137u8, 97u8, 33u8, 101u8, 36u8, 211u8, 156u8, 60u8, + 43u8, 161u8, 15u8, 30u8, 11u8, 136u8, 136u8, 205u8, 26u8, 213u8, 240u8, + 32u8, 229u8, 28u8, 67u8, 169u8, 101u8, 31u8, 233u8, 171u8, 15u8, 132u8, + 50u8, 178u8, 172u8, 55u8, 180u8, 219u8, 220u8, 205u8, 228u8, 72u8, ], ) } @@ -12780,9 +12776,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 197u8, 84u8, 7u8, 131u8, 39u8, 116u8, 87u8, 162u8, 191u8, 22u8, 149u8, - 32u8, 170u8, 171u8, 14u8, 44u8, 74u8, 109u8, 237u8, 37u8, 64u8, 143u8, - 15u8, 146u8, 117u8, 143u8, 167u8, 155u8, 7u8, 188u8, 91u8, 77u8, + 220u8, 8u8, 255u8, 128u8, 27u8, 98u8, 171u8, 31u8, 176u8, 88u8, 125u8, + 181u8, 26u8, 227u8, 195u8, 28u8, 119u8, 70u8, 199u8, 22u8, 80u8, 117u8, + 165u8, 100u8, 134u8, 172u8, 48u8, 63u8, 144u8, 159u8, 35u8, 222u8, ], ) } @@ -18431,7 +18427,7 @@ pub mod api { #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct SetFinalityBanConfig { pub minimal_expected_performance: - ::core::option::Option<::core::primitive::u32>, + ::core::option::Option<::core::primitive::u16>, pub underperformed_session_count_threshold: ::core::option::Option<::core::primitive::u32>, pub ban_period: ::core::option::Option<::core::primitive::u32>, @@ -18523,7 +18519,7 @@ pub mod api { #[doc = "See [`Pallet::set_finality_ban_config`]."] pub fn set_finality_ban_config( &self, - minimal_expected_performance: ::core::option::Option<::core::primitive::u32>, + minimal_expected_performance: ::core::option::Option<::core::primitive::u16>, underperformed_session_count_threshold: ::core::option::Option< ::core::primitive::u32, >, @@ -18538,9 +18534,10 @@ pub mod api { ban_period, }, [ - 180u8, 124u8, 250u8, 39u8, 54u8, 18u8, 182u8, 94u8, 160u8, 29u8, 123u8, - 142u8, 171u8, 219u8, 157u8, 47u8, 59u8, 30u8, 102u8, 179u8, 153u8, - 98u8, 230u8, 66u8, 210u8, 25u8, 93u8, 167u8, 70u8, 172u8, 185u8, 15u8, + 196u8, 38u8, 57u8, 173u8, 103u8, 130u8, 199u8, 15u8, 15u8, 104u8, + 149u8, 206u8, 148u8, 41u8, 235u8, 181u8, 121u8, 115u8, 147u8, 213u8, + 45u8, 75u8, 24u8, 90u8, 201u8, 42u8, 80u8, 145u8, 105u8, 46u8, 141u8, + 21u8, ], ) } @@ -18934,10 +18931,9 @@ pub mod api { "FinalityBanConfig", vec![], [ - 177u8, 234u8, 226u8, 9u8, 22u8, 105u8, 39u8, 95u8, 183u8, 233u8, 233u8, - 7u8, 168u8, 121u8, 174u8, 88u8, 176u8, 111u8, 153u8, 215u8, 164u8, - 126u8, 195u8, 176u8, 78u8, 242u8, 29u8, 117u8, 163u8, 117u8, 209u8, - 236u8, + 70u8, 49u8, 141u8, 237u8, 7u8, 194u8, 13u8, 160u8, 125u8, 114u8, 206u8, + 100u8, 242u8, 219u8, 16u8, 110u8, 125u8, 16u8, 60u8, 37u8, 31u8, 17u8, + 143u8, 156u8, 51u8, 85u8, 255u8, 252u8, 126u8, 125u8, 223u8, 207u8, ], ) } @@ -19247,10 +19243,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 220u8, 96u8, 141u8, 95u8, 69u8, 113u8, 21u8, 146u8, 255u8, 255u8, - 122u8, 232u8, 244u8, 152u8, 252u8, 84u8, 147u8, 174u8, 28u8, 177u8, - 51u8, 11u8, 69u8, 145u8, 94u8, 223u8, 9u8, 178u8, 58u8, 77u8, 53u8, - 240u8, + 87u8, 51u8, 168u8, 224u8, 85u8, 30u8, 242u8, 156u8, 124u8, 166u8, + 166u8, 110u8, 177u8, 135u8, 96u8, 20u8, 144u8, 246u8, 117u8, 114u8, + 155u8, 146u8, 208u8, 67u8, 164u8, 20u8, 52u8, 149u8, 84u8, 198u8, + 193u8, 33u8, ], ) } @@ -19462,10 +19458,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 15u8, 109u8, 148u8, 153u8, 187u8, 105u8, 14u8, 102u8, 244u8, 160u8, - 96u8, 94u8, 209u8, 57u8, 192u8, 223u8, 176u8, 130u8, 111u8, 108u8, - 231u8, 248u8, 110u8, 0u8, 1u8, 188u8, 89u8, 43u8, 148u8, 190u8, 87u8, - 17u8, + 236u8, 199u8, 121u8, 168u8, 52u8, 57u8, 138u8, 89u8, 118u8, 195u8, + 27u8, 125u8, 195u8, 94u8, 63u8, 80u8, 3u8, 207u8, 147u8, 135u8, 30u8, + 3u8, 104u8, 126u8, 135u8, 222u8, 201u8, 200u8, 14u8, 248u8, 38u8, 1u8, ], ) } @@ -22305,7 +22300,7 @@ pub mod api { #[doc = "See [`Pallet::set_finality_ban_config`]."] set_finality_ban_config { minimal_expected_performance: - ::core::option::Option<::core::primitive::u32>, + ::core::option::Option<::core::primitive::u16>, underperformed_session_count_threshold: ::core::option::Option<::core::primitive::u32>, ban_period: ::core::option::Option<::core::primitive::u32>, @@ -27678,7 +27673,7 @@ pub mod api { #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] pub struct FinalityBanConfig { - pub minimal_expected_performance: ::core::primitive::u32, + pub minimal_expected_performance: ::core::primitive::u16, pub underperformed_session_count_threshold: ::core::primitive::u32, pub ban_period: ::core::primitive::u32, } @@ -27698,7 +27693,7 @@ pub mod api { pub struct Score { pub session_id: ::core::primitive::u32, pub nonce: ::core::primitive::u32, - pub points: ::std::vec::Vec<::core::primitive::u32>, + pub points: ::std::vec::Vec<::core::primitive::u16>, } #[derive( :: subxt :: ext :: codec :: Decode, diff --git a/finality-aleph/src/abft/current/performance/mod.rs b/finality-aleph/src/abft/current/performance/mod.rs index cb05b0369d..5cc4e4175e 100644 --- a/finality-aleph/src/abft/current/performance/mod.rs +++ b/finality-aleph/src/abft/current/performance/mod.rs @@ -1,5 +1,6 @@ use crate::{data_io::AlephData, Hasher}; +mod scorer; mod service; pub use service::Service; diff --git a/finality-aleph/src/abft/current/performance/scorer.rs b/finality-aleph/src/abft/current/performance/scorer.rs new file mode 100644 index 0000000000..edde034014 --- /dev/null +++ b/finality-aleph/src/abft/current/performance/scorer.rs @@ -0,0 +1,152 @@ +use current_aleph_bft::{NodeCount, NodeMap, Round}; + +use crate::{abft::current::performance::Batch, aleph_primitives::RawScore, UnverifiedHeader}; + +/// Scoring ABFT performance based on returned ordered unit batches. +pub struct Scorer { + newest_unit_by: NodeMap, +} + +impl Scorer { + /// Create a new scorer for the provided node count. + pub fn new(node_count: NodeCount) -> Self { + Scorer { + newest_unit_by: NodeMap::with_size(node_count), + } + } + + /// Add a batch of ordered units and return a score consisting of numbers of rounds a specific + /// node is behind. + pub fn process_batch(&mut self, batch: Batch) -> RawScore { + let max_round = batch.last().expect("batches always contain a head").round; + for unit in batch { + // Units are always added in order, so any unit created by an honest node + // here has a round greater than any that was included earlier. + // This is not necessarily true for forkers, but punishing them is fine. + self.newest_unit_by.insert(unit.creator, unit.round) + } + let all_nodes = self.newest_unit_by.size().into_iterator(); + all_nodes + .map(|node_id| { + self.newest_unit_by + .get(node_id) + // All other units have lower round than head, so the saturating_sub is just + // subtraction. + .map(|unit_round| max_round.saturating_sub(*unit_round)) + // If we don't have a unit it's the same as having a unit of round equal to -1. + .unwrap_or(max_round.saturating_add(1)) + }) + .collect() + } +} + +#[cfg(test)] +mod tests { + use std::iter; + + use current_aleph_bft::{NodeCount, OrderedUnit, Round}; + + use super::Scorer; + use crate::{block::mock::MockHeader, data_io::AlephData, Hasher}; + + const NODE_COUNT: NodeCount = NodeCount(7); + + fn units_up_to(max_round: Round) -> Vec, Hasher>>> { + let mut result = Vec::new(); + for round in 0..=max_round { + let mut round_units = Vec::new(); + for creator in NODE_COUNT.into_iterator() { + round_units.push(OrderedUnit { + data: None, + // We ignore the parents, so just putting nothing here. + parents: Vec::new(), + hash: Hasher::random_hash(), + creator, + round, + }); + } + result.push(round_units); + } + result + } + + #[test] + fn processes_initial_batch() { + let mut scorer = Scorer::new(NODE_COUNT); + let unit = units_up_to(0) + .pop() + .expect("there is a round") + .pop() + .expect("there is a unit"); + assert_eq!(scorer.process_batch(vec![unit]), vec![1, 1, 1, 1, 1, 1, 0]); + } + + #[test] + fn processes_perfect_performance_batch() { + let mut scorer = Scorer::new(NODE_COUNT); + let mut all_units = units_up_to(1); + let mut round_one_units = all_units.pop().expect("just created"); + let mut round_zero_units = all_units.pop().expect("just created"); + let first_head = round_zero_units.pop().expect("there is a unit"); + assert_eq!( + scorer.process_batch(vec![first_head]), + vec![1, 1, 1, 1, 1, 1, 0] + ); + let second_head = round_one_units.pop().expect("there is a unit"); + round_zero_units.push(second_head); + assert_eq!( + scorer.process_batch(round_zero_units), + vec![1, 1, 1, 1, 1, 1, 0] + ); + } + + #[test] + fn processes_lacking_creator_batch() { + let mut scorer = Scorer::new(NODE_COUNT); + let mut all_units = units_up_to(1); + let mut round_one_units = all_units.pop().expect("just created"); + round_one_units.pop(); + let mut round_zero_units = all_units.pop().expect("just created"); + round_zero_units.pop(); + let first_head = round_zero_units.pop().expect("there is a unit"); + assert_eq!( + scorer.process_batch(vec![first_head]), + vec![1, 1, 1, 1, 1, 0, 1] + ); + let second_head = round_one_units.pop().expect("there is a unit"); + round_zero_units.push(second_head); + assert_eq!( + scorer.process_batch(round_zero_units), + vec![1, 1, 1, 1, 1, 0, 2] + ); + } + + #[test] + fn processes_lagging_creator_batch() { + let mut scorer = Scorer::new(NODE_COUNT); + let mut all_units = units_up_to(2); + let mut round_two_units = all_units.pop().expect("just created"); + round_two_units.pop(); + let mut round_one_units = all_units.pop().expect("just created"); + round_one_units.pop(); + let mut round_zero_units = all_units.pop().expect("just created"); + let lagged_unit = round_zero_units.pop().expect("just created"); + let first_head = round_zero_units.pop().expect("there is a unit"); + assert_eq!( + scorer.process_batch(vec![first_head]), + vec![1, 1, 1, 1, 1, 0, 1] + ); + let second_head = round_one_units.pop().expect("there is a unit"); + round_zero_units.push(second_head); + assert_eq!( + scorer.process_batch(round_zero_units), + vec![1, 1, 1, 1, 1, 0, 2] + ); + let third_head = round_two_units.pop().expect("there is a unit"); + let third_batch = iter::once(lagged_unit) + .chain(round_one_units) + .chain(iter::once(third_head)) + .collect(); + assert_eq!(scorer.process_batch(third_batch), vec![1, 1, 1, 1, 1, 0, 2]); + } +} diff --git a/finality-aleph/src/abft/current/performance/service.rs b/finality-aleph/src/abft/current/performance/service.rs index 8a55c7e63e..88928f8da2 100644 --- a/finality-aleph/src/abft/current/performance/service.rs +++ b/finality-aleph/src/abft/current/performance/service.rs @@ -1,11 +1,15 @@ +use current_aleph_bft::NodeCount; use futures::{ channel::{mpsc, oneshot}, StreamExt, }; -use log::{debug, warn}; +use log::{debug, error, warn}; use crate::{ - abft::{current::performance::Batch, LOG_TARGET}, + abft::{ + current::performance::{scorer::Scorer, Batch}, + LOG_TARGET, + }, data_io::AlephData, party::manager::Runnable, Hasher, UnverifiedHeader, @@ -59,6 +63,7 @@ where UH: UnverifiedHeader, { batches_from_abft: mpsc::UnboundedReceiver>, + scorer: Scorer, } impl Service @@ -68,6 +73,7 @@ where /// Create a new service, together with a unit finalization handler that should be passed to /// ABFT. It will wrap the provided finalization handler and call it in the background. pub fn new( + n_members: usize, finalization_handler: FH, ) -> ( Self, @@ -78,7 +84,10 @@ where { let (batches_for_us, batches_from_abft) = mpsc::unbounded(); ( - Service { batches_from_abft }, + Service { + batches_from_abft, + scorer: Scorer::new(NodeCount(n_members)), + }, FinalizationWrapper::new(finalization_handler, batches_for_us), ) } @@ -92,8 +101,16 @@ where async fn run(mut self, mut exit: oneshot::Receiver<()>) { loop { tokio::select! { - _maybe_batch = self.batches_from_abft.next() => { - // TODO(A0-4575): actually compute the score form batches etc + maybe_batch = self.batches_from_abft.next() => { + let score = match maybe_batch { + Some(batch) => self.scorer.process_batch(batch), + None => { + error!(target: LOG_TARGET, "Batches' channel closed, ABFT performance scoring terminating."); + break; + }, + }; + debug!(target: LOG_TARGET, "Received ABFT score: {:?}.", score); + // TODO(A0-4339): sometimes submit these scores to the chain. } _ = &mut exit => { debug!(target: LOG_TARGET, "ABFT performance scoring task received exit signal. Terminating."); diff --git a/finality-aleph/src/abft/traits.rs b/finality-aleph/src/abft/traits.rs index 8f65f4a4ee..098584b8e5 100644 --- a/finality-aleph/src/abft/traits.rs +++ b/finality-aleph/src/abft/traits.rs @@ -50,6 +50,13 @@ impl Wrapper { inner: ::hash(s), } } + + #[cfg(test)] + pub fn random_hash() -> OrdForHash { + use rand::distributions::{Alphanumeric, DistString}; + let string = Alphanumeric.sample_string(&mut rand::thread_rng(), 137); + Self::hash(string.as_ref()) + } } impl current_aleph_bft::Hasher for Wrapper { diff --git a/finality-aleph/src/party/manager/mod.rs b/finality-aleph/src/party/manager/mod.rs index 8f98a20e88..82fdb4fcae 100644 --- a/finality-aleph/src/party/manager/mod.rs +++ b/finality-aleph/src/party/manager/mod.rs @@ -275,7 +275,7 @@ where session_boundaries.clone(), ); let (abft_performance, abft_batch_handler) = - CurrentPerformanceService::new(ordered_data_interpreter); + CurrentPerformanceService::new(n_members, ordered_data_interpreter); let consensus_config = current_create_aleph_config(n_members, node_id, session_id, self.unit_creation_delay); let data_network = data_network.map(); diff --git a/pallets/committee-management/src/lib.rs b/pallets/committee-management/src/lib.rs index 4366815334..9f3aec13e9 100644 --- a/pallets/committee-management/src/lib.rs +++ b/pallets/committee-management/src/lib.rs @@ -274,7 +274,7 @@ pub mod pallet { #[pallet::weight((T::BlockWeights::get().max_block, DispatchClass::Operational))] pub fn set_finality_ban_config( origin: OriginFor, - minimal_expected_performance: Option, + minimal_expected_performance: Option, underperformed_session_count_threshold: Option, ban_period: Option, ) -> DispatchResult { diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index b685589a6e..9f190921a8 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -221,14 +221,14 @@ pub trait AbftScoresProvider { #[derive(Decode, Encode, TypeInfo, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct FinalityBanConfig { /// Number representing how many rounds a parent of a head of an abft round is allowed to be behind the head. - pub minimal_expected_performance: u32, + pub minimal_expected_performance: u16, /// How many bad sessions force validator to be removed from the committee pub underperformed_session_count_threshold: SessionCount, /// how many eras a validator is banned for pub ban_period: EraIndex, } -pub const DEFAULT_FINALITY_BAN_MINIMAL_EXPECTED_PERFORMANCE: u32 = 11; +pub const DEFAULT_FINALITY_BAN_MINIMAL_EXPECTED_PERFORMANCE: u16 = 11; pub const DEFAULT_FINALITY_BAN_SESSION_COUNT_THRESHOLD: SessionCount = 2; impl Default for FinalityBanConfig { @@ -448,11 +448,13 @@ pub mod staking { pub type ScoreNonce = u32; +pub type RawScore = Vec; + #[derive(PartialEq, Decode, Encode, TypeInfo, Debug, Clone)] pub struct Score { pub session_id: SessionIndex, pub nonce: ScoreNonce, - pub points: Vec, + pub points: RawScore, } pub mod crypto {