diff --git a/crates/fuzz/src/actor.rs b/crates/fuzz/src/actor.rs index c85797bc..142798cb 100644 --- a/crates/fuzz/src/actor.rs +++ b/crates/fuzz/src/actor.rs @@ -161,6 +161,12 @@ impl Actor { } pub fn check_history(&mut self) { + // let json = self + // .loro + // .export_json_updates(&Default::default(), &self.loro.oplog_vv()); + // let string = serde_json::to_string_pretty(&json).unwrap(); + // tracing::info!("json = {}", string); + for (f, v) in self.history.iter() { let f = Frontiers::from(f); let from = &self.loro.state_frontiers(); diff --git a/crates/fuzz/tests/undo.rs b/crates/fuzz/tests/undo.rs index 27917634..b70b808c 100644 --- a/crates/fuzz/tests/undo.rs +++ b/crates/fuzz/tests/undo.rs @@ -3375,979 +3375,247 @@ fn tree_parent_remap() { } #[test] -fn minify() { - minify_simple( +fn tree_undo_sort_index() { + test_multi_sites( 5, - |n, actions| test_multi_sites(n, vec![FuzzTarget::Tree], actions), - |_, actions| actions.to_vec(), - vec![ - SyncAll, + vec![FuzzTarget::All], + &mut [ Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(117901063), - bool: true, - key: 4294903559, - pos: 18446744073709551615, - length: 18446744070186336255, - prop: 506381209882853375, - }), - }, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(-1), - bool: true, - key: 4294967295, - pos: 18446744069566171401, - length: 18446744073709027327, - prop: 15355022929519706111, - }), - }, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, + site: 187, + target: 122, + container: 36, action: Generic(GenericAction { value: Container(Unknown(255)), bool: true, - key: 151650303, - pos: 18446744073709488393, - length: 18446744073709551607, - prop: 2242546323825885183, + key: 4287627263, + pos: 4902828863, + length: 9335720388467884032, + prop: 226866784668584321, }), }, Handle { - site: 31, - target: 255, - container: 255, + site: 27, + target: 27, + container: 27, action: Generic(GenericAction { - value: Container(Text), + value: I32(454761243), bool: true, - key: 4294904073, - pos: 18446744039349813247, - length: 18446744073709551615, - prop: 18446744073709540631, - }), - }, - Handle { - site: 31, - target: 31, - container: 120, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 151587327, - pos: 17870283321406127881, - length: 18446744073709551615, - prop: 18446744073709551615, + key: 2812782503, + pos: 12080808863958804391, + length: 12058485138819360679, + prop: 12080808863958804391, }), }, SyncAllUndo { - site: 255, - op_len: 522190847, + site: 167, + op_len: 2812782503, }, SyncAllUndo { - site: 255, - op_len: 2543162669, + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, }, - SyncAll, Handle { - site: 31, - target: 31, - container: 31, + site: 27, + target: 27, + container: 27, action: Generic(GenericAction { - value: I32(-225), + value: I32(454761434), bool: true, - key: 4294967295, - pos: 3746995852044863999, - length: 3689348814751478831, - prop: 3689349566361187123, + key: 454761243, + pos: 1953184666628070171, + length: 144115188075855871, + prop: 4557431447142210354, }), }, Handle { - site: 0, - target: 0, - container: 203, - action: Generic(GenericAction { - value: I32(-67160012), - bool: false, - key: 14354243, - pos: 18446512270787554605, - length: 132529457269757440, - prop: 3689631393508504599, - }), - }, - Sync { from: 154, to: 57 }, - Handle { - site: 52, + site: 93, target: 52, - container: 56, + container: 27, action: Generic(GenericAction { - value: I32(755030791), + value: I32(1061109567), bool: true, - key: 757935405, - pos: 18446744073558622207, - length: 18446642734358855679, - prop: 10798258750077476863, + key: 1061109567, + pos: 1953184666628079423, + length: 1953184666628070171, + prop: 12080808260305368626, }), }, SyncAllUndo { - site: 149, - op_len: 1101628309, - }, - Checkout { - site: 255, - to: 797179861, - }, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(-52481), - bool: true, - key: 4294967295, - pos: 2242545361753210879, - length: 18446743107869875999, - prop: 651333096108457983, - }), - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Checkout { - site: 255, - to: 797179861, - }, - SyncAll, - SyncAll, - SyncAllUndo { - site: 169, - op_len: 4294913857, - }, - SyncAll, - Handle { - site: 255, - target: 255, - container: 255, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 522190847, - pos: 3977020664822308639, - length: 18446744070240221241, - prop: 2242545361753210879, - }), + site: 167, + op_len: 2812782503, }, Handle { - site: 255, - target: 255, - container: 255, + site: 27, + target: 27, + container: 27, action: Generic(GenericAction { - value: Container(Text), + value: I32(454810139), bool: true, - key: 4294967049, - pos: 18446744073709551615, - length: 651333096108457983, - prop: 18446744073709488393, - }), - }, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 213, - target: 163, - container: 255, - action: Generic(GenericAction { - value: I32(-618717409), - bool: true, - key: 2509581823, - pos: 18387987999889921431, - length: 3423861436305875967, - prop: 18446744073694871551, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 120, - container: 31, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 2267596630907625247, - length: 18446744073709551391, - prop: 18446744073693429759, - }), - }, - SyncAll, - Handle { - site: 31, - target: 120, - container: 31, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 151587081, - pos: 18444492273895866367, - length: 18446744073709551615, - prop: 18446744072989704191, - }), - }, - Handle { - site: 37, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(-1), - bool: true, - key: 4294967295, - pos: 18446744069566171401, - length: 18446744073709027327, - prop: 2305843009213693951, - }), - }, - Handle { - site: 120, - target: 31, - container: 31, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4278782217, - pos: 18446735277616529407, - length: 18446744073709551615, - prop: 18446744073706739711, - }), - }, - Checkout { - site: 37, - to: 2015305503, - }, - SyncAll, - SyncAll, - Handle { - site: 255, - target: 255, - container: 255, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 18446744073709551615, - length: 2242792614424466711, - prop: 10749528904694701855, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 120, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294904319, - pos: 18446744073709551615, - length: 2267596630907625247, - prop: 18446744073709551391, - }), - }, - Handle { - site: 9, - target: 255, - container: 255, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 18446744072989704191, - length: 2242551955064881151, - prop: 18446744069936740383, - }), - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 213, - target: 163, - container: 255, - action: Generic(GenericAction { - value: I32(-618717409), - bool: true, - key: 2509581823, - pos: 18387987999889921431, - length: 3423861436305875967, - prop: 18446744073694871551, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 95, - target: 120, - container: 31, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 2267596630907625247, - length: 18446744073709551391, - prop: 18446472533143846911, - }), - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAllUndo { - site: 43, - op_len: 2214581759, - }, - SyncAll, - SyncAll, - SyncAllUndo { - site: 131, - op_len: 4281287081, - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 55, - container: 57, - action: Generic(GenericAction { - value: I32(-13552072), - bool: true, - key: 4294967295, - pos: 2242545357980434431, - length: 18400582177514266488, - prop: 651061559686070271, - }), - }, - SyncAll, - SyncAll, - SyncAll, - Sync { from: 163, to: 255 }, - SyncAll, - SyncAll, - Sync { from: 163, to: 255 }, - Handle { - site: 31, - target: 31, - container: 219, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 8655671227355963391, - length: 18446744073709494047, - prop: 18446744069582356479, - }), - }, - SyncAll, - Handle { - site: 31, - target: 31, - container: 120, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 151587327, - pos: 17870283321406127881, - length: 18446744073709551615, - prop: 18446708705056522239, - }), - }, - Handle { - site: 31, - target: 37, - container: 31, - action: Generic(GenericAction { - value: I32(-225), - bool: true, - key: 4294967295, - pos: 18446743013004216831, - length: 18446744073575333887, - prop: 18446744073709551615, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 219, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 522190847, - pos: 18383446805802065695, - length: 18446744073709551414, - prop: 2242545361753210879, - }), - }, - Handle { - site: 255, - target: 255, - container: 255, - action: Generic(GenericAction { - value: Container(Text), - bool: true, - key: 4294967049, - pos: 18446744073575333887, - length: 1729382256910270463, - prop: 11817199131615536085, + key: 454761243, + pos: 1953184666628070171, + length: 18446744073709551387, + prop: 4557573824704098817, }), }, SyncAllUndo { - site: 47, - op_len: 4280287231, - }, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 225, - target: 224, - container: 135, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 151650303, - pos: 18446744073709488393, - length: 18446744073709551607, - prop: 18420801199931391999, - }), + site: 167, + op_len: 2812782503, }, SyncAllUndo { - site: 43, - op_len: 2214581759, + site: 167, + op_len: 2812782503, }, - SyncAll, - SyncAll, - SyncAll, - Checkout { - site: 55, - to: 825636921, - }, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(-1), - bool: true, - key: 4294967295, - pos: 18446744069566171401, - length: 18446743133111189503, - prop: 1729382256910270463, - }), - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 219, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 10922800496058040319, - length: 18446514557796193685, - prop: 18388060938407193507, - }), - }, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 95, - action: Generic(GenericAction { - value: I32(-51457), - bool: true, - key: 4294967295, - pos: 2242545361753210879, - length: 18446743107869875999, - prop: 651333096108457983, - }), - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Checkout { - site: 255, - to: 797179861, - }, - SyncAll, - SyncAll, SyncAllUndo { - site: 169, - op_len: 4294913857, - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(522133279), - bool: true, - key: 354361208, - pos: 18374686479671623680, - length: 10798258750077476863, - prop: 18446743616657790357, - }), - }, - SyncAll, - Handle { - site: 31, - target: 31, - container: 255, - action: Generic(GenericAction { - value: I32(522133279), - bool: false, - key: 4294909727, - pos: 720575940379279359, - length: 18446744073693366537, - prop: 18446744073709549567, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 37, - container: 31, - action: Generic(GenericAction { - value: I32(-225), - bool: true, - key: 4294967295, - pos: 18446743013004216831, - length: 18446744073575333887, - prop: 18446744073709551615, - }), - }, - Handle { - site: 31, - target: 120, - container: 31, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 151587081, - pos: 18444492273895866367, - length: 18446744073709551615, - prop: 18446744072989704191, - }), - }, - Handle { - site: 37, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(-1), - bool: true, - key: 4294967295, - pos: 9223372032711395593, - length: 18446744073709027327, - prop: 18446744073709551615, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 219, - container: 149, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 2267596630907625247, - length: 18446744073709551391, - prop: 18446744073693429759, - }), - }, - SyncAll, - Handle { - site: 31, - target: 120, - container: 31, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 151587081, - pos: 18444492273895866367, - length: 18446744069649465343, - prop: 18446744072989704191, - }), - }, - Handle { - site: 37, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(-1), - bool: true, - key: 4294967295, - pos: 18446744069566171401, - length: 18446744073709027327, - prop: 18446744073709551615, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 219, - container: 149, - action: Generic(GenericAction { - value: Container(MovableList), - bool: true, - key: 4294913857, - pos: 18388060938407193507, - length: 18446744073709494271, - prop: 18446744073709551615, - }), - }, - Handle { - site: 31, - target: 95, - container: 120, - action: Generic(GenericAction { - value: I32(-1), - bool: true, - key: 4294967295, - pos: 2242545357980434431, - length: 18446744073694814072, - prop: 651061559686070271, - }), - }, - SyncAll, - SyncAll, - SyncAll, - Sync { from: 163, to: 255 }, - SyncAllUndo { - site: 43, - op_len: 2214581759, - }, - SyncAll, - SyncAll, - SyncAllUndo { - site: 131, - op_len: 4281287081, - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 55, - container: 57, - action: Generic(GenericAction { - value: I32(-13552072), - bool: true, - key: 4294967295, - pos: 2242545357980434431, - length: 18400582177514266488, - prop: 651061559686070271, - }), - }, - SyncAll, - SyncAll, - SyncAll, - Sync { from: 163, to: 255 }, - SyncAll, - SyncAll, - Sync { from: 163, to: 255 }, - Handle { - site: 31, - target: 31, - container: 219, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 3078831103, - pos: 2242545357980434305, - length: 14974415777474989855, - prop: 14974415777481871311, - }), - }, - Sync { from: 207, to: 207 }, - Sync { from: 207, to: 207 }, - Sync { from: 207, to: 207 }, - Sync { from: 31, to: 31 }, - SyncAllUndo { - site: 151, - op_len: 1099142549, - }, - Checkout { - site: 255, - to: 797179861, - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(891232031), - bool: true, - key: 522156063, - pos: 18446744073709549567, - length: 144114526650892287, - prop: 18446744073709551615, - }), - }, - SyncAll, - Handle { - site: 31, - target: 31, - container: 219, - action: Generic(GenericAction { - value: Container(Map), - bool: true, - key: 732168191, - pos: 2305842113780110847, - length: 18434921212611133231, - prop: 18446743111636823939, - }), - }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 255, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294913535, - pos: 18446744073709551615, - length: 2242545357995114271, - prop: 1729135000460140319, - }), - }, - SyncAll, - Handle { - site: 219, - target: 149, - container: 149, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4292214571, - pos: 18446743111636823939, - length: 18446744073709551615, - prop: 18446744073695789055, - }), - }, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(892673823), - bool: true, - key: 4280229752, - pos: 18446744073709551607, - length: 18375249427041353727, - prop: 18446744073709551615, - }), - }, - SyncAll, - Handle { - site: 31, - target: 219, - container: 149, - action: Generic(GenericAction { - value: Container(Map), - bool: true, - key: 4281050111, - pos: 3395714115539566549, - length: 9511556229955321855, - prop: 18446744069951455023, - }), - }, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: Container(Unknown(255)), - bool: true, - key: 4294967295, - pos: 18446744073709497855, - length: 2305842047141019647, - prop: 2242545357980376863, - }), - }, - Sync { from: 163, to: 255 }, - Handle { - site: 31, - target: 31, - container: 219, - action: Generic(GenericAction { - value: Container(Map), - bool: true, - key: 732168191, - pos: 2305842113780110847, - length: 18446744073709551615, - prop: 18385945478740049919, - }), - }, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(-1780771553), - bool: true, - key: 2508428695, - pos: 15420091632514445121, - length: 18446497783091266559, - prop: 18446744073709551615, - }), - }, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 37, - action: Generic(GenericAction { - value: I32(2015311157), - bool: true, - key: 3250700575, - pos: 13961653357748797889, - length: 13961653357748797889, - prop: 13961653357748797889, - }), - }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - SyncAll, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: Container(Tree), - bool: true, - key: 792827267, - pos: 9511556229955321855, - length: 18446744069951455023, - prop: 18446744073709551615, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 31, - action: Generic(GenericAction { - value: I32(891232031), - bool: true, - key: 522156063, - pos: 18446744073709549567, - length: 13961721794801958911, - prop: 13961653357748797889, - }), - }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - Sync { from: 193, to: 193 }, - SyncAll, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 219, - action: Generic(GenericAction { - value: Container(Map), - bool: true, - key: 732168191, - pos: 2305842113780110847, - length: 18446744073709551615, - prop: 18446743171766419455, - }), - }, - SyncAll, - SyncAll, - Handle { - site: 31, - target: 31, - container: 14, - action: Generic(GenericAction { - value: I32(-16777216), - bool: true, - key: 522133503, - pos: 10779248702831402783, - length: 18446744070207407032, - prop: 2242545357980434431, - }), + site: 167, + op_len: 2812782503, + }, + ], + ) +} + +#[test] +fn minify() { + minify_simple( + 5, + |n, actions| test_multi_sites(n, vec![FuzzTarget::All], actions), + |_, actions| actions.to_vec(), + vec![ + Handle { + site: 187, + target: 122, + container: 36, + action: Generic(GenericAction { + value: Container(Unknown(255)), + bool: true, + key: 4287627263, + pos: 4902828863, + length: 9335720388467884032, + prop: 226866784668584321, + }), + }, + Handle { + site: 27, + target: 27, + container: 27, + action: Generic(GenericAction { + value: I32(454761243), + bool: true, + key: 2812782503, + pos: 12080808863958804391, + length: 12058485138819360679, + prop: 12080808863958804391, + }), + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + Handle { + site: 27, + target: 27, + container: 27, + action: Generic(GenericAction { + value: I32(454761434), + bool: true, + key: 454761243, + pos: 1953184666628070171, + length: 144115188075855871, + prop: 4557431447142210354, + }), + }, + Handle { + site: 93, + target: 52, + container: 27, + action: Generic(GenericAction { + value: I32(1061109567), + bool: true, + key: 1061109567, + pos: 1953184666628079423, + length: 1953184666628070171, + prop: 12080808260305368626, + }), + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + Handle { + site: 27, + target: 27, + container: 27, + action: Generic(GenericAction { + value: I32(454810139), + bool: true, + key: 454761243, + pos: 1953184666628070171, + length: 18446744073709551387, + prop: 4557573824704098817, + }), + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, + }, + SyncAllUndo { + site: 167, + op_len: 2812782503, }, ], ) diff --git a/crates/loro-internal/src/diff_calc/tree.rs b/crates/loro-internal/src/diff_calc/tree.rs index ebc4d8d2..fbd5fa01 100644 --- a/crates/loro-internal/src/diff_calc/tree.rs +++ b/crates/loro-internal/src/diff_calc/tree.rs @@ -449,7 +449,12 @@ impl TreeCacheForDiff { ans.push((*tree_id, op.position.clone(), op.id_full())); } } - ans.sort_by(|a, b| a.1.cmp(&b.1)); + // The children should be sorted by the position. + // If the fractional index is the same, then sort by the lamport and peer. + ans.sort_by(|a, b| { + a.1.cmp(&b.1) + .then(a.2.lamport.cmp(&b.2.lamport).then(a.2.peer.cmp(&b.2.peer))) + }); ans } }