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

feat(CLI): add --wasm args to bump/restore #775

Merged
merged 7 commits into from
Jul 20, 2023

Conversation

willemneal
Copy link
Member

Currently installed contract code can expire and we need a way to bump and restore them.

@willemneal
Copy link
Member Author

@paulbellamy Currently when trying using restore on the wasm with installed contracts that have expired (hello world contract in soroban examples) and bump on a recently installed contract, both result in the error:

error: Ledger entry not found

@anupsdf
Copy link

anupsdf commented Jul 17, 2023

@paulbellamy Currently when trying using restore on the wasm with installed contracts that have expired (hello world contract in soroban examples) and bump on a recently installed contract, both result in the error:

error: Ledger entry not found

Hey Willem, Do you have the tx meta handy for this error? We can get more insight on where the error is coming from.

@willemneal
Copy link
Member Author

Rerunning with the soroban --vv, I get:

2023-07-18T11:54:56.783070Z TRACE soroban_cli::commands::contract::restore: network=Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022" }
2023-07-18T11:54:56.785584Z TRACE soroban_cli::rpc: uri=https://rpc-futurenet.stellar.org:443/
2023-07-18T11:54:56.816499Z TRACE soroban_cli::rpc: Getting address GDIY6AQQ75WMD4W46EYB7O6UYMHOCGQHLAQGQTKHDX4J2DYQCHVCR4W4
2023-07-18T11:54:57.114327Z TRACE soroban_cli::rpc: account=AccountEntry { account_id: AccountId(PublicKeyTypeEd25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28))), balance: 99997051580, seq_num: SequenceNumber(60670708023341), 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: 50183, seq_time: TimePoint(1689622304) }) }) }) }
2023-07-18T11:54:57.115628Z TRACE soroban_cli::rpc: tx=Transaction { source_account: Ed25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28)), fee: 100, seq_num: SequenceNumber(60670708023342), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: RestoreFootprint(RestoreFootprintOp { ext: V0 }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([]), read_write: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(629a66f4cae880542584d39119e8a28a59fc50724a15ef1a5cee9ae1c1c475c5), body_type: DataEntry })]) }, instructions: 0, read_bytes: 0, write_bytes: 0, extended_meta_data_size_bytes: 0 }, refundable_fee: 0 }) }
2023-07-18T11:54:57.115745Z TRACE soroban_cli::rpc: tx=Tx(TransactionV1Envelope { tx: Transaction { source_account: Ed25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28)), fee: 100, seq_num: SequenceNumber(60670708023342), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: RestoreFootprint(RestoreFootprintOp { ext: V0 }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([]), read_write: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(629a66f4cae880542584d39119e8a28a59fc50724a15ef1a5cee9ae1c1c475c5), body_type: DataEntry })]) }, instructions: 0, read_bytes: 0, write_bytes: 0, extended_meta_data_size_bytes: 0 }, refundable_fee: 0 }) }, signatures: VecM([]) })
2023-07-18T11:54:57.377306Z TRACE soroban_cli::rpc: response=SimulateTransactionResponse { error: None, transaction_data: "AAAAAAAAAAAAAAABAAAAB2KaZvTK6IBUJYTTkRnooopZ/FByShXvGlzumuHBxHXFAAAAAAAAAAAAAAKAAAACgAAABQAAAAAAAAAA+g==", events: [], min_resource_fee: 34349, results: [SimulateHostFunctionResult { auth: [], xdr: "" }], cost: Cost { cpu_insns: "0", mem_bytes: "0" }, latest_ledger: 61402 }
2023-07-18T11:54:57.511051Z TRACE soroban_cli::rpc: tx=Tx(TransactionV1Envelope { tx: Transaction { source_account: Ed25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28)), fee: 34449, seq_num: SequenceNumber(60670708023342), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: RestoreFootprint(RestoreFootprintOp { ext: V0 }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([]), read_write: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(629a66f4cae880542584d39119e8a28a59fc50724a15ef1a5cee9ae1c1c475c5), body_type: DataEntry })]) }, instructions: 0, read_bytes: 640, write_bytes: 640, extended_meta_data_size_bytes: 1280 }, refundable_fee: 250 }) }, signatures: VecM([DecoratedSignature { hint: SignatureHint(1011ea28), signature: Signature(BytesM(05aa6763f2ea16f4bc898cea9a159572c50d5f02f847f2183bb16289553cf2a29e82f3e4e5c294853f47dbfb73f4a731c532b5a2527d3363b1cbd18763428e0d)) }]) })
2023-07-18T11:55:03.401011Z TRACE soroban_cli::rpc: response=GetTransactionResponse { status: "SUCCESS", envelope_xdr: Some("AAAAAgAAAADRjwIQ/2zB8tzxMB+71MMO4RoHWCBoTUcd+J0PEBHqKAAAhpEAADcuAAAALgAAAAAAAAAAAAAAAQAAAAAAAAAaAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAHYppm9MrogFQlhNORGeiiiln8UHJKFe8aXO6a4cHEdcUAAAAAAAAAAAAAAoAAAAKAAAAFAAAAAAAAAAD6AAAAARAR6igAAABABapnY/LqFvS8iYzqmhWVcsUNXwL4R/IYO7FiiVU88qKegvPk5cKUhT9H2/tz9KcxxTK1olJ9M2Oxy9GHY0KODQ=="), result_xdr: Some("AAAAAAAAhL0AAAAAAAAAAQA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4wLjkuMiNiZmRkYmMzODBlMmIyM2M3MTA2OWJkNjEyYjg5MTc3NDAwNDM3YTgwAAAAQw5jb250cmFjdHNwZWN2MAAAAAAAAAAAAAAABWhlbGxvAAAAAAAAAQAAAAAAAAACdG8AAAAAABEAAAABAAAD6gAAABEAAAD/3AAAAAAAAAACAAAAAwAA79wAAAAAAAAAANGPAhD/bMHy3PEwH7vUww7hGgdYIGhNRx34nQ8QEeooAAAAF0hJZm8AADcuAAAALgAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAAADv3AAAAABktn2XAAAAAAAAAAEAAO/cAAAAAAAAAADRjwIQ/2zB8tzxMB+71MMO4RoHWCBoTUcd+J0PEBHqKAAAABdISWdpAAA3LgAAAC4AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAA79wAAAAAZLZ9lwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=") }
2023-07-18T11:55:03.401683Z DEBUG soroban_cli::commands::contract::restore: result=TransactionResult { fee_charged: 33981, result: TxSuccess(VecM([OpInner(RestoreFootprint(Success))])), ext: V0 }

I still get the entry not present, but there is a comment about how the transactionResult will always succeed, so the entry must be checked.

@sisuresh
Copy link
Contributor

Rerunning with the soroban --vv, I get:

2023-07-18T11:54:56.783070Z TRACE soroban_cli::commands::contract::restore: network=Network { rpc_url: "https://rpc-futurenet.stellar.org:443", network_passphrase: "Test SDF Future Network ; October 2022" }
2023-07-18T11:54:56.785584Z TRACE soroban_cli::rpc: uri=https://rpc-futurenet.stellar.org:443/
2023-07-18T11:54:56.816499Z TRACE soroban_cli::rpc: Getting address GDIY6AQQ75WMD4W46EYB7O6UYMHOCGQHLAQGQTKHDX4J2DYQCHVCR4W4
2023-07-18T11:54:57.114327Z TRACE soroban_cli::rpc: account=AccountEntry { account_id: AccountId(PublicKeyTypeEd25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28))), balance: 99997051580, seq_num: SequenceNumber(60670708023341), 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: 50183, seq_time: TimePoint(1689622304) }) }) }) }
2023-07-18T11:54:57.115628Z TRACE soroban_cli::rpc: tx=Transaction { source_account: Ed25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28)), fee: 100, seq_num: SequenceNumber(60670708023342), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: RestoreFootprint(RestoreFootprintOp { ext: V0 }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([]), read_write: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(629a66f4cae880542584d39119e8a28a59fc50724a15ef1a5cee9ae1c1c475c5), body_type: DataEntry })]) }, instructions: 0, read_bytes: 0, write_bytes: 0, extended_meta_data_size_bytes: 0 }, refundable_fee: 0 }) }
2023-07-18T11:54:57.115745Z TRACE soroban_cli::rpc: tx=Tx(TransactionV1Envelope { tx: Transaction { source_account: Ed25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28)), fee: 100, seq_num: SequenceNumber(60670708023342), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: RestoreFootprint(RestoreFootprintOp { ext: V0 }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([]), read_write: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(629a66f4cae880542584d39119e8a28a59fc50724a15ef1a5cee9ae1c1c475c5), body_type: DataEntry })]) }, instructions: 0, read_bytes: 0, write_bytes: 0, extended_meta_data_size_bytes: 0 }, refundable_fee: 0 }) }, signatures: VecM([]) })
2023-07-18T11:54:57.377306Z TRACE soroban_cli::rpc: response=SimulateTransactionResponse { error: None, transaction_data: "AAAAAAAAAAAAAAABAAAAB2KaZvTK6IBUJYTTkRnooopZ/FByShXvGlzumuHBxHXFAAAAAAAAAAAAAAKAAAACgAAABQAAAAAAAAAA+g==", events: [], min_resource_fee: 34349, results: [SimulateHostFunctionResult { auth: [], xdr: "" }], cost: Cost { cpu_insns: "0", mem_bytes: "0" }, latest_ledger: 61402 }
2023-07-18T11:54:57.511051Z TRACE soroban_cli::rpc: tx=Tx(TransactionV1Envelope { tx: Transaction { source_account: Ed25519(Uint256(d18f0210ff6cc1f2dcf1301fbbd4c30ee11a075820684d471df89d0f1011ea28)), fee: 34449, seq_num: SequenceNumber(60670708023342), cond: None, memo: None, operations: VecM([Operation { source_account: None, body: RestoreFootprint(RestoreFootprintOp { ext: V0 }) }]), ext: V1(SorobanTransactionData { ext: V0, resources: SorobanResources { footprint: LedgerFootprint { read_only: VecM([]), read_write: VecM([ContractCode(LedgerKeyContractCode { hash: Hash(629a66f4cae880542584d39119e8a28a59fc50724a15ef1a5cee9ae1c1c475c5), body_type: DataEntry })]) }, instructions: 0, read_bytes: 640, write_bytes: 640, extended_meta_data_size_bytes: 1280 }, refundable_fee: 250 }) }, signatures: VecM([DecoratedSignature { hint: SignatureHint(1011ea28), signature: Signature(BytesM(05aa6763f2ea16f4bc898cea9a159572c50d5f02f847f2183bb16289553cf2a29e82f3e4e5c294853f47dbfb73f4a731c532b5a2527d3363b1cbd18763428e0d)) }]) })
2023-07-18T11:55:03.401011Z TRACE soroban_cli::rpc: response=GetTransactionResponse { status: "SUCCESS", envelope_xdr: Some("AAAAAgAAAADRjwIQ/2zB8tzxMB+71MMO4RoHWCBoTUcd+J0P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PHYugI3AwBBACECA0ACQCACQRBHDQBBACECAkADQCACQRBGDQEgAUEQaiACaiABIAJqKQMANwMAIAJBCGohAgwACwsgAUEQaq1CIIZCBIRChICAgCAQgICAgAAhACABQSBqJICAgIAAIAAPCyABQRBqIAJqQgI3AwAgAkEIaiECDAALCwAACwIACwAeEWNvbnRyYWN0ZW52bWV0YXYwAAAAAAAAABQAAAAzAG8OY29udHJhY3RtZXRhdjAAAAAAAAAABXJzdmVyAAAAAAAABjEuNzAuMAAAAAAAAAAAAAhyc3Nka3ZlcgAAAC4wLjkuMiNiZmRkYmMzODBlMmIyM2M3MTA2OWJkNjEyYjg5MTc3NDAwNDM3YTgwAAAAQw5jb250cmFjdHNwZWN2MAAAAAAAAAAAAAAABWhlbGxvAAAAAAAAAQAAAAAAAAACdG8AAAAAABEAAAABAAAD6gAAABEAAAD/3AAAAAAAAAACAAAAAwAA79wAAAAAAAAAANGPAhD/bMHy3PEwH7vUww7hGgdYIGhNRx34nQ8QEeooAAAAF0hJZm8AADcuAAAALgAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAAADv3AAAAABktn2XAAAAAAAAAAEAAO/cAAAAAAAAAADRjwIQ/2zB8tzxMB+71MMO4RoHWCBoTUcd+J0PEBHqKAAAABdISWdpAAA3LgAAAC4AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAA79wAAAAAZLZ9lwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=") }
2023-07-18T11:55:03.401683Z DEBUG soroban_cli::commands::contract::restore: result=TransactionResult { fee_charged: 33981, result: TxSuccess(VecM([OpInner(RestoreFootprint(Success))])), ext: V0 }

I still get the entry not present, but there is a comment about how the transactionResult will always succeed, so the entry must be checked.

This is the decoded OperationMeta you posted. It looks like the expiration ledger (65500) is larger than the current ledger (61404). Maybe one of the CLI validation checks is incorrect?

operations = [
      { changes = [
          { type = LEDGER_ENTRY_CREATED,
            created = {
              lastModifiedLedgerSeq = 61404,
              data = {
                type = CONTRACT_CODE,
                contractCode = {
                  ext = {
                    v = 0
                  },
                  hash = 629a66f4cae880542584d39119e8a28a59fc50724a15ef1a5cee9ae1c1c475c5,
                  body = {
                    bodyType = DATA_ENTRY,
                    code = 0061736d01000000010f0360027e7e017e60017e017e600000020701017601470000030302010205030100100619037f01418080c0000b7f00418080c0000b7f00418080c0000b073105066d656d6f727902000568656c6c6f0001015f00020a5f5f646174615f656e6403010b5f5f686561705f6261736503020ac80102c20101027f23808080800041206b2201248080808000024002402000a741ff01712202410e460d00200241ca00470d010b200120003703082001428ee8f1d8ba02370300410021020340024020024110470d00410021020240034020024110460d01200141106a20026a200120026a290300370300200241086a21020c000b0b200141106aad4220864204844284808080201080808080002100200141206a24808080800020000f0b200141106a20026a4202370300200241086a21020c000b0b00000b02000b001e11636f6e7472616374656e766d6574617630000000000000001400000033006f0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e37302e3000000000000000000008727373646b7665720000002e302e392e322362666464626333383065326232336337313036396264363132623839313737343030343337613830000000430e636f6e747261637473706563763000000000000000000000000568656c6c6f000000000000010000000000000002746f00000000001100000001000003ea00000011
                  },
                  expirationLedgerSeq = 65500
                }
              },
              ext = {
                v = 0
              }
            } }
        ] }
    ]

@tsachiherman tsachiherman added this to the Soroban Testnet Release milestone Jul 18, 2023
@tsachiherman tsachiherman self-assigned this Jul 18, 2023
@sisuresh
Copy link
Contributor

Ah it might be this - https://github.com/stellar/soroban-tools/blob/4ebeeea9541031f9585cbfb8bf73ec5533cb3a7d/cmd/soroban-cli/src/commands/contract/restore.rs#L189C9-L189C9. It's expecting ContractData but we can also restore ContractCode @tsachiherman.

@willemneal
Copy link
Member Author

@sisuresh Thanks! I updated to check for the correct ledger entry and it seems to be working. For a bump that is.

However, since there is a minimum time of 6 hours expiration, I will need to wait to test restore. Unless there is a negative bump, but it seems unsigned ints are used (rightfully so) in the transaction.

@tsachiherman
Copy link
Contributor

@sreuland could you take a look on this PR, as we might need to make changes to the system-test accordingly.

@willemneal
Copy link
Member Author

Luckily the increment contract was expired so I was able to try restore and it worked! However, the return value was not what a ledger update but rather a creation. Just updated the code and will try again once another contract binary expires

@tsachiherman
Copy link
Contributor

issue : #782

@sreuland
Copy link
Contributor

sreuland commented Jul 19, 2023

@sreuland could you take a look on this PR, as we might need to make changes to the system-test accordingly.

if this changeset were to make contract install idempotent, then I would say system-test does not need to change immediately as there would be no net breaking change in UX. is that possible? if not good approach, then yes, need to change system test to be more defensive and run contract bump/restore as needed around the existingcontract install usages otherwise it won't produce repeatable results.

also, in general, we should add new coverage for contract bump|restore in system-test, captured here on stellar/system-test#70

@tsachiherman tsachiherman enabled auto-merge (squash) July 20, 2023 14:22
@tsachiherman tsachiherman linked an issue Jul 20, 2023 that may be closed by this pull request
@tsachiherman tsachiherman merged commit a5506b4 into stellar:main Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Allows the restore command to restore contractCode
5 participants