Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: get tests passing on latest versions #932

Merged
merged 5 commits into from
Sep 8, 2023

Conversation

sreuland
Copy link
Contributor

@sreuland sreuland commented Sep 6, 2023

What

e2e.yml references to component versions

Why

get status on system test coverage with latest from tools and external componenets(core, js-soroban-client, example contracts)

Closes: #928

Known limitations

@sreuland
Copy link
Contributor Author

sreuland commented Sep 6, 2023

@willemneal , any thoughts on this error when a test runs cli with soroban contract deploy:

running command soroban [contract deploy --wasm-hash d24da803c661875e3a947f28c240904899d5b66a9fe2833ebcd6482e6a114609 --rpc-url http://localhost:8000/soroban/rpc --source SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L --network-passphrase Standalone Network ; February 2017] 

error: transaction simulation failed: cannot set authorization entries

Caused by:
    HostError: Error(Auth, InternalError)
    DebugInfo not available

the test successfully ran contract install first, then attempted the contract deploy, it looks like cli may be passing auth entries in op.auth json of invokehostfn op as part of contract deploy, but the rpc preflight endpoint is reporting it can't apply the auth from json request - https://github.com/stellar/soroban-tools/blob/main/cmd/soroban-rpc/lib/preflight/src/preflight.rs#L63

I was able to turn up LOG_LEVEL=debug on rpc server and captured the simulation request payload from cli:

time="2023-09-06T23:08:52.829Z" level=info msg="starting JSONRPC request" json_req=45 method=simulateTransaction pid=1769 req=90 subsys=jsonrpc
time="2023-09-06T23:08:52.829Z" level=debug msg="starting JSONRPC request params" json_req=45 method=simulateTransaction params="[\"AAAAAgAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1gABB60AAAAAAAAABQAAAAAAAAAAAAAAAQAAAAAAAAAYAAAAAQAAAAAAAAAAAAAAAHN2/eiOTNYcwPspSheGs/HQYfXy8cpXRl+qkyIRuUbWjJHZp++wf6+NzO/fnkA97CdeP2CDGStW2H2OSArJ/wUAAAAAnpGmxiNM96Q/3klzn+yPLC9Auf2waGUOelkON5FzG8cAAAABAAAAAAAAAAEAAAAAAAAAAAAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1oyR2afvsH+vjczv355APewnXj9ggxkrVth9jkgKyf8FAAAAAJ6RpsYjTPekP95Jc5/sjywvQLn9sGhlDnpZDjeRcxvHAAAAAAAAAAEAAAAAAAAAAQAAAAeekabGI0z3pD/eSXOf7I8sL0C5/bBoZQ56WQ43kXMbxwAAAAEAAAAGAAAAAbdd7KKVOq+wBVFIcBATY4vLm1dJ5mG1AuncuXnDmbpYAAAAFAAAAAEAAboLAAACsAAAAGgAAAAAAABOWQAAAAA=\"]" pid=1769 req=90 subsys=jsonrpc
time="2023-09-06T23:08:52.830Z" level=info msg="finished JSONRPC request" duration="589.625µs" json_req=90 pid=1769 req=90 status=error subsys=jsonrpc
time="2023-09-06T23:08:52.830Z" level=debug msg="Completed 1 requests [665.125µs elapsed]" pid=1769
time="2023-09-06T23:08:52.830Z" level=info msg="finished request" bytes=293 duration="908.125µs" method=POST path=/ pid=1769 req=f7fbf9db6fcc/rrnzNWOrUh-000089 route=/ status=200 subsys=http


captured verbose mode on cli output:

soroban --very-verbose contract deploy --wasm-hash 9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7 --rpc-url http://localhost:8000/soroban/rpc/ --source SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L --network-passphrase "Standalone Network ; February 2017"
2023-09-07T19:20:28.306547Z TRACE soroban_cli::rpc: uri=http://localhost:8000/soroban/rpc/
2023-09-07T19:20:28.306989Z TRACE soroban_cli::rpc: Getting network
2023-09-07T19:20:28.506246Z TRACE soroban_cli::rpc: Getting address GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI
2023-09-07T19:20:28.683132Z TRACE soroban_cli::rpc: account=AccountEntry { account_id: AccountId(PublicKeyTypeEd25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6))), balance: 999999989899945550, seq_num: SequenceNumber(2), num_sub_entries: 0, inflation_dest: None, flags: 0, home_domain: String32(StringM()), thresholds: Thresholds(01000000), signers: VecM([]), ext: V1(AccountEntryExtensionV1 { liabilities: Liabilities { buying: 0, selling: 0 }, ext: V2(AccountEntryExtensionV2 { num_sponsored: 0, num_sponsoring: 0, signer_sponsoring_i_ds: VecM([]), ext: V3(AccountEntryExtensionV3 { ext: V0, seq_ledger: 689, seq_time: TimePoint(1694114264) }) }) }) }
2023-09-07T19:20:28.686153Z TRACE soroban_cli::rpc: Getting latest ledger
2023-09-07T19:20:28.848692Z TRACE soroban_cli::rpc: tx=Transaction { source_account: Ed25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)), fee: 100, seq_num: SequenceNumber(3), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: InvokeHostFunction(InvokeHostFunctionOp { host_function: CreateContract(CreateContractArgs { contract_id_preimage: Address(ContractIdPreimageFromAddress { address: Account(AccountId(PublicKeyTypeEd25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)))), salt: Uint256(9c908135ff9eba0e23d5beb9bddb17efd9e790b6d66ec1474c30dbc3d0f468ef) }), executable: Wasm(Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7)) }), auth: VecM([]) }) }]), ext: V0 }
2023-09-07T19:20:28.848788Z TRACE soroban_cli::rpc: tx=Tx(TransactionV1Envelope { tx: Transaction { source_account: Ed25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)), fee: 100, seq_num: SequenceNumber(3), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: InvokeHostFunction(InvokeHostFunctionOp { host_function: CreateContract(CreateContractArgs { contract_id_preimage: Address(ContractIdPreimageFromAddress { address: Account(AccountId(PublicKeyTypeEd25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)))), salt: Uint256(9c908135ff9eba0e23d5beb9bddb17efd9e790b6d66ec1474c30dbc3d0f468ef) }), executable: Wasm(Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7)) }), auth: VecM([]) }) }]), ext: V0 }, signatures: VecM([]) })
2023-09-07T19:20:29.014352Z TRACE soroban_cli::rpc: response=SimulateTransactionResponse { min_resource_fee: 58597, cost: Cost { cpu_insns: 63163, mem_bytes: 5491 }, results: [SimulateHostFunctionResult { auth: ["AAAAAAAAAAEAAAAAAAAAAAAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1pyQgTX/nroOI9W+ub3bF+/Z55C21m7BR0ww28PQ9GjvAAAAAJ6RpsYjTPekP95Jc5/sjywvQLn9sGhlDnpZDjeRcxvHAAAAAA=="], xdr: "AAAAEgAAAAH+qbbBN4Dg0BDd6xODHApzC8tB+RgC/KEfUezrZwyQmQ==" }], transaction_data: "AAAAAAAAAAEAAAAHnpGmxiNM96Q/3klzn+yPLC9Auf2waGUOelkON5FzG8cAAAABAAAABgAAAAH+qbbBN4Dg0BDd6xODHApzC8tB+RgC/KEfUezrZwyQmQAAABQAAAABAAG6CwAAArAAAABoAAAAAAAATlk=", events: [], restore_preamble: Some(RestorePreamble { transaction_data: "", min_resource_fee: 0 }), latest_ledger: 852, error: None }
2023-09-07T19:20:29.014945Z TRACE soroban_cli::rpc: tx=Transaction { source_account: Ed25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)), fee: 67501, seq_num: SequenceNumber(3), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: InvokeHostFunction(InvokeHostFunctionOp { host_function: CreateContract(CreateContractArgs { contract_id_preimage: Address(ContractIdPreimageFromAddress { address: Account(AccountId(PublicKeyTypeEd25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)))), salt: Uint256(9c908135ff9eba0e23d5beb9bddb17efd9e790b6d66ec1474c30dbc3d0f468ef) }), executable: Wasm(Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7)) }), auth: VecM([SorobanAuthorizationEntry { credentials: SourceAccount, root_invocation: SorobanAuthorizedInvocation { function: CreateContractHostFn(CreateContractArgs { contract_id_preimage: Address(ContractIdPreimageFromAddress { address: Account(AccountId(PublicKeyTypeEd25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)))), salt: Uint256(9c908135ff9eba0e23d5beb9bddb17efd9e790b6d66ec1474c30dbc3d0f468ef) }), executable: Wasm(Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7)) }), sub_invocations: VecM([]) } }]) }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7) })]), read_write: VecM([ContractData(LedgerKeyContractData { contract: Contract(Hash(fea9b6c13780e0d010ddeb13831c0a730bcb41f91802fca11f51eceb670c9099)), key: LedgerKeyContractInstance, durability: Persistent })]) }, instructions: 113163, read_bytes: 688, write_bytes: 104 }, refundable_fee: 20057 }) }
2023-09-07T19:20:29.015015Z TRACE soroban_cli::rpc: tx=Tx(TransactionV1Envelope { tx: Transaction { source_account: Ed25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)), fee: 67501, seq_num: SequenceNumber(3), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: InvokeHostFunction(InvokeHostFunctionOp { host_function: CreateContract(CreateContractArgs { contract_id_preimage: Address(ContractIdPreimageFromAddress { address: Account(AccountId(PublicKeyTypeEd25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)))), salt: Uint256(9c908135ff9eba0e23d5beb9bddb17efd9e790b6d66ec1474c30dbc3d0f468ef) }), executable: Wasm(Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7)) }), auth: VecM([SorobanAuthorizationEntry { credentials: SourceAccount, root_invocation: SorobanAuthorizedInvocation { function: CreateContractHostFn(CreateContractArgs { contract_id_preimage: Address(ContractIdPreimageFromAddress { address: Account(AccountId(PublicKeyTypeEd25519(Uint256(7376fde88e4cd61cc0fb294a1786b3f1d061f5f2f1ca57465faa932211b946d6)))), salt: Uint256(9c908135ff9eba0e23d5beb9bddb17efd9e790b6d66ec1474c30dbc3d0f468ef) }), executable: Wasm(Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7)) }), sub_invocations: VecM([]) } }]) }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(9e91a6c6234cf7a43fde49739fec8f2c2f40b9fdb068650e7a590e3791731bc7) })]), read_write: VecM([ContractData(LedgerKeyContractData { contract: Contract(Hash(fea9b6c13780e0d010ddeb13831c0a730bcb41f91802fca11f51eceb670c9099)), key: LedgerKeyContractInstance, durability: Persistent })]) }, instructions: 113163, read_bytes: 688, write_bytes: 104 }, refundable_fee: 20057 }) }, signatures: VecM([]) })
2023-09-07T19:20:29.174316Z TRACE soroban_cli::rpc: response=SimulateTransactionResponse { min_resource_fee: 0, cost: Cost { cpu_insns: 0, mem_bytes: 0 }, results: [], transaction_data: "", events: [], restore_preamble: Some(RestorePreamble { transaction_data: "", min_resource_fee: 0 }), latest_ledger: 853, error: Some("cannot set authorization entries\n\nCaused by:\n    HostError: Error(Auth, InternalError)\n    DebugInfo not available\n    ") }
error: transaction simulation failed: cannot set authorization entries

Caused by:
    HostError: Error(Auth, InternalError)
    DebugInfo not available


@willemneal
Copy link
Member

@sreuland I think I figured it out: #942

@sreuland
Copy link
Contributor Author

sreuland commented Sep 8, 2023

@sreuland I think I figured it out: #942

@willemneal , thanks for checking that out, @tamirms also was looking into it and submitted a different approach - https://github.com/stellar/soroban-tools/pull/939/files, it was merged to main and then ported back into here, it has resolved that issue with preflight.

@sreuland sreuland marked this pull request as ready for review September 8, 2023 22:01
@sreuland sreuland merged commit ec404da into stellar:main Sep 8, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E2E: assert tests passing on latest versions for testnet launch
5 participants