stellar / rs-soroban-env

Rust environment for Soroban contracts.
Apache License 2.0
60 stars 40 forks source link

Observations files bloat crates #1294

Closed brson closed 8 months ago

brson commented 9 months ago

I noticed that the soroban-env-host crate, 20.0.0, was 2MB in size, which seems big. The culprits are the observation files, which I think are only used for testing, and possibly not useful in the published crate. Here's a representative sample of the contents of the crate sorted by size:

-rw-r--r-- 0/0           90681 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__stellar_asset_contract__test_set_admin.json
-rw-r--r-- 0/0           93918 2006-07-24 01:21 soroban-env-host-20.0.0/src/auth.rs
-rw-r--r-- 0/0           95979 2006-07-24 01:21 soroban-env-host-20.0.0/src/test/stellar_asset_contract.rs
-rw-r--r-- 0/0          103967 2006-07-24 01:21 soroban-env-host-20.0.0/src/host.rs
-rw-r--r-- 0/0          112848 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__stellar_asset_contract__test_transfer_with_allowance.json
-rw-r--r-- 0/0          113749 2006-07-24 01:21 soroban-env-host-20.0.0/src/test/auth.rs
-rw-r--r-- 0/0          130315 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__stellar_asset_contract__test_classic_account_multisig_auth.json
-rw-r--r-- 0/0          131803 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__stellar_asset_contract__test_trustline_auth.json
-rw-r--r-- 0/0          144668 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__stellar_asset_contract__test_burn.json
-rw-r--r-- 0/0          201829 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__depth_limit__deep_host_val_to_scval.json
-rw-r--r-- 0/0          421036 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__depth_limit__deep_host_obj_cmp.json
-rw-r--r-- 0/0         1079959 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__hostile_opt__test_deep_stack_call_fails_with_deep_xdr_deserialization.json
-rw-r--r-- 0/0         1079976 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__hostile_opt__test_deep_stack_call_fails_xdr_deserialization_exceeding_host_object_depth.json
-rw-r--r-- 0/0         1079978 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__hostile_opt__test_deep_stack_call_fails_with_too_deep_xdr_deserialization.json
-rw-r--r-- 0/0         1082376 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__hostile_opt__test_deep_stack_call_succeeds_near_limit_with_xdr_deserialization.json
-rw-r--r-- 0/0         1095033 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__hostile_opt__test_deep_stack_call_fails_when_contract_call_depth_exceeded.json
-rw-r--r-- 0/0         1110518 2006-07-24 01:21 soroban-env-host-20.0.0/observations/test__hostile_opt__test_deep_stack_call_succeeds_near_limit.json
leighmcculloch commented 9 months ago

We should be able to exclude the files from the crate.

Same with the SDK and it's test fixtures.

graydon commented 9 months ago

Oh, yeah, they should never be included in the crate, this is a mistake.