-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds several new observation types to the test observer. The most important part is that it now observes the state of the auth manager, which is reports with two separate values: a (size,hash) pair for the current auth stack, and a (size,hash) pair for the sum of all the trackers. I _think_ this is probably the most useful way to eyeball changes, but @dmkozh should confirm (and maybe give a look at the recorded observation traces here to see if they make sense to you)
- Loading branch information
Showing
334 changed files
with
37,400 additions
and
37,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use crate::{ | ||
AddressObject, BytesObject, DurationObject, I128Object, I256Object, I64Object, MapObject, | ||
Object, StringObject, Symbol, SymbolObject, TimepointObject, U128Object, U256Object, U64Object, | ||
Val, VecObject, | ||
}; | ||
|
||
// These impls exist strictly for use in test observation. Since they do not | ||
// "look through" to the environment they are misleading and potentially | ||
// dangerous to expose for general use. | ||
|
||
impl core::hash::Hash for Val { | ||
fn hash<H: core::hash::Hasher>(&self, state: &mut H) { | ||
self.get_payload().hash(state); | ||
} | ||
} | ||
|
||
macro_rules! impl_hash_for_wrapper { | ||
($WRAPPER:ident) => { | ||
impl core::hash::Hash for $WRAPPER { | ||
fn hash<H: core::hash::Hasher>(&self, state: &mut H) { | ||
self.as_val().get_payload().hash(state); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
impl_hash_for_wrapper!(Object); | ||
impl_hash_for_wrapper!(U64Object); | ||
impl_hash_for_wrapper!(I64Object); | ||
impl_hash_for_wrapper!(TimepointObject); | ||
impl_hash_for_wrapper!(DurationObject); | ||
impl_hash_for_wrapper!(U128Object); | ||
impl_hash_for_wrapper!(I128Object); | ||
impl_hash_for_wrapper!(U256Object); | ||
impl_hash_for_wrapper!(I256Object); | ||
impl_hash_for_wrapper!(BytesObject); | ||
impl_hash_for_wrapper!(StringObject); | ||
impl_hash_for_wrapper!(SymbolObject); | ||
impl_hash_for_wrapper!(Symbol); | ||
impl_hash_for_wrapper!(VecObject); | ||
impl_hash_for_wrapper!(MapObject); | ||
impl_hash_for_wrapper!(AddressObject); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__basic__f32_does_not_work.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 1 end": "cpu:1313281, mem:156225, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-" | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 end": "cpu:1313281, mem:156225, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__basic__i32_as_seen_by_host.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 1 end": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-" | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 end": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__basic__i64_roundtrip.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 call obj_from_i64(9223372036854775807)": "", | ||
" 2 ret obj_from_i64 -> Ok(I64(obj#1))": "cpu:1249, mem:64, objs:-/1@505c85d5", | ||
" 3 call obj_to_i64(I64(obj#1))": "", | ||
" 4 ret obj_to_i64 -> Ok(9223372036854775807)": "cpu:1716", | ||
" 5 end": "cpu:1716, mem:64, prngs:-/-, objs:-/1@505c85d5, vmem:-, evt:-, store:-/-" | ||
" 5 end": "cpu:1716, mem:64, prngs:-/-, objs:-/1@505c85d5, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
6 changes: 3 additions & 3 deletions
6
soroban-env-host/observations/test__basic__tuple_roundtrip.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 call vec_new_from_slice(2)": "", | ||
" 2 ret vec_new_from_slice -> Ok(Vec(obj#1))": "cpu:2787, mem:96, objs:-/1@9d1ee4bc", | ||
" 2 ret vec_new_from_slice -> Ok(Vec(obj#1))": "cpu:2787, mem:96, objs:-/1@8af88039", | ||
" 3 call vec_unpack_to_slice(Vec(obj#1), 2)": "", | ||
" 4 ret vec_unpack_to_slice -> Ok(Void)": "cpu:3147", | ||
" 5 end": "cpu:3147, mem:96, prngs:-/-, objs:-/1@9d1ee4bc, vmem:-, evt:-, store:-/-" | ||
" 5 end": "cpu:3147, mem:96, prngs:-/-, objs:-/1@8af88039, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__basic__u32_as_seen_by_host.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 1 end": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-" | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 end": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__basic__u64_roundtrip.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 call obj_from_u64(18446744073709551615)": "", | ||
" 2 ret obj_from_u64 -> Ok(U64(obj#1))": "cpu:1249, mem:64, objs:-/1@ecad9fd5", | ||
" 3 call obj_to_u64(U64(obj#1))": "", | ||
" 4 ret obj_to_u64 -> Ok(18446744073709551615)": "cpu:1716", | ||
" 5 end": "cpu:1716, mem:64, prngs:-/-, objs:-/1@ecad9fd5, vmem:-, evt:-, store:-/-" | ||
" 5 end": "cpu:1716, mem:64, prngs:-/-, objs:-/1@ecad9fd5, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__budget_metering__xdr_object_conversion.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
" 0 begin": "cpu:9996, mem:0, prngs:-/9b4a753, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 1 end": "cpu:3, mem:3, prngs:-/9b4a753, objs:-/1@e6201d48, vmem:-, evt:-, store:-/-" | ||
" 0 begin": "cpu:9996, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 end": "cpu:3, mem:3, prngs:-/9b4a753, objs:-/1@fba13d84, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__bytes__bytes_put_out_of_bound.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 call bytes_new()": "", | ||
" 2 ret bytes_new -> Ok(Bytes(obj#1))": "cpu:1249, mem:64, objs:-/1@5b7170d7", | ||
" 3 call bytes_put(Bytes(obj#1), U32(0), U32(1))": "", | ||
" 4 ret bytes_put -> Err(Error(Object, IndexBounds))": "cpu:3109, mem:80", | ||
" 5 end": "cpu:3109, mem:80, prngs:-/-, objs:-/1@5b7170d7, vmem:-, evt:-, store:-/-" | ||
" 5 end": "cpu:3109, mem:80, prngs:-/-, objs:-/1@5b7170d7, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__bytes__bytes_slice_start_greater_than_end.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 call bytes_new_from_slice(4)": "", | ||
" 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:2785, mem:84, objs:-/1@5311c87f", | ||
" 3 call bytes_slice(Bytes(obj#1), U32(2), U32(1))": "", | ||
" 4 ret bytes_slice -> Err(Error(Object, InvalidInput))": "cpu:3001", | ||
" 5 end": "cpu:3001, mem:84, prngs:-/-, objs:-/1@5311c87f, vmem:-, evt:-, store:-/-" | ||
" 5 end": "cpu:3001, mem:84, prngs:-/-, objs:-/1@5311c87f, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
4 changes: 2 additions & 2 deletions
4
soroban-env-host/observations/test__bytes__bytes_slice_start_greater_than_len.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vmem:-, evt:-, store:-/-", | ||
" 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", | ||
" 1 call bytes_new_from_slice(4)": "", | ||
" 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:2785, mem:84, objs:-/1@5311c87f", | ||
" 3 call bytes_slice(Bytes(obj#1), U32(5), U32(10))": "", | ||
" 4 ret bytes_slice -> Err(Error(Object, IndexBounds))": "cpu:3001", | ||
" 5 end": "cpu:3001, mem:84, prngs:-/-, objs:-/1@5311c87f, vmem:-, evt:-, store:-/-" | ||
" 5 end": "cpu:3001, mem:84, prngs:-/-, objs:-/1@5311c87f, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.