From e7b681fbed14c798de1972f19a5d74c7ad7540f8 Mon Sep 17 00:00:00 2001 From: Dmytro Kozhevin Date: Tue, 1 Oct 2024 14:36:47 -0400 Subject: [PATCH 1/4] Misc fixes/improvements for tx generator. The improvements include: - Properly close the ledgers for compatibility with BLDB - Increased I/O modeled instructions to cover larger writes - Account for the cost recalibration when setting up a test network config - Add per-ledger modelled/real insns ratio metrics to reduce variance - Add more logs to `apply-load` command Also added a smoke test for the apply load utility. --- src/ledger/NetworkConfig.cpp | 119 ++++++++++++++++++ src/ledger/NetworkConfig.h | 2 + src/ledger/SorobanMetrics.cpp | 24 +++- src/ledger/SorobanMetrics.h | 9 ++ src/main/CommandLine.cpp | 35 +++++- src/simulation/ApplyLoad.cpp | 45 ++++--- src/simulation/TxGenerator.cpp | 45 ++++--- src/simulation/TxGenerator.h | 12 +- src/simulation/test/LoadGeneratorTests.cpp | 85 +++++++++++++ src/test/TxTests.cpp | 4 +- .../InvokeHostFunctionOpFrame.cpp | 3 + 11 files changed, 339 insertions(+), 44 deletions(-) diff --git a/src/ledger/NetworkConfig.cpp b/src/ledger/NetworkConfig.cpp index 95ef83417d..a842be46ea 100644 --- a/src/ledger/NetworkConfig.cpp +++ b/src/ledger/NetworkConfig.cpp @@ -1156,6 +1156,7 @@ SorobanNetworkConfig::initializeGenesisLedgerForTesting( ltx.loadHeader().current().ledgerVersion = static_cast(SOROBAN_PROTOCOL_VERSION); SorobanNetworkConfig::createLedgerEntriesForV20(ltx, app); + updateRecalibratedCostTypesForV20(ltx); ltx.loadHeader().current().ledgerVersion = genesisLedgerProtocol; } @@ -1927,6 +1928,124 @@ SorobanNetworkConfig::evictionIterator() { return mEvictionIterator; } + +void +SorobanNetworkConfig::updateRecalibratedCostTypesForV20( + AbstractLedgerTxn& ltxRoot) +{ + LedgerTxn ltx(ltxRoot); + + LedgerKey key(CONFIG_SETTING); + key.configSetting().configSettingID = + ConfigSettingID::CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS; + + auto& cpuParams = ltx.load(key) + .current() + .data.configSetting() + .contractCostParamsCpuInsns(); + + for (size_t val = 0; val < cpuParams.size(); ++val) + { + switch (val) + { + case DispatchHostFunction: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 295, 0}; + break; + case VisitObject: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 60, 0}; + break; + case ValSer: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 221, 26}; + break; + case ValDeser: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 331, 4369}; + break; + case ComputeSha256Hash: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 3636, 7013}; + break; + case ComputeEd25519PubKey: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 40256, 0}; + break; + case VerifyEd25519Sig: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 377551, 4059}; + break; + case VmInstantiation: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 417482, 45712}; + break; + case VmCachedInstantiation: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 417482, 45712}; + break; + case InvokeVmFunction: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 1945, 0}; + break; + case ComputeKeccak256Hash: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 6481, 5943}; + break; + case DecodeEcdsaCurve256Sig: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 711, 0}; + break; + case RecoverEcdsaSecp256k1Key: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 2314804, 0}; + break; + case Int256AddSub: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 4176, 0}; + break; + case Int256Mul: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 4716, 0}; + break; + case Int256Div: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 4680, 0}; + break; + case Int256Pow: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 4256, 0}; + break; + case Int256Shift: + cpuParams[val] = ContractCostParamEntry{ExtensionPoint{0}, 884, 0}; + break; + case ChaCha20DrawBytes: + cpuParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 1059, 502}; + break; + default: + break; + } + } + + LedgerKey memKey(CONFIG_SETTING); + memKey.configSetting().configSettingID = + ConfigSettingID::CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES; + + auto& memParams = ltx.load(memKey) + .current() + .data.configSetting() + .contractCostParamsMemBytes(); + for (size_t val = 0; val < memParams.size(); ++val) + { + switch (val) + { + case VmInstantiation: + memParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 132773, 4903}; + break; + case VmCachedInstantiation: + memParams[val] = + ContractCostParamEntry{ExtensionPoint{0}, 132773, 4903}; + break; + default: + break; + } + } + + ltx.commit(); +} #endif bool diff --git a/src/ledger/NetworkConfig.h b/src/ledger/NetworkConfig.h index f5265bf916..c3d36e04e9 100644 --- a/src/ledger/NetworkConfig.h +++ b/src/ledger/NetworkConfig.h @@ -335,6 +335,8 @@ class SorobanNetworkConfig #ifdef BUILD_TESTS StateArchivalSettings& stateArchivalSettings(); EvictionIterator& evictionIterator(); + + static void updateRecalibratedCostTypesForV20(AbstractLedgerTxn& ltx); #endif bool operator==(SorobanNetworkConfig const& other) const; diff --git a/src/ledger/SorobanMetrics.cpp b/src/ledger/SorobanMetrics.cpp index 399c121544..36753d94fe 100644 --- a/src/ledger/SorobanMetrics.cpp +++ b/src/ledger/SorobanMetrics.cpp @@ -128,9 +128,23 @@ SorobanMetrics::SorobanMetrics(medida::MetricsRegistry& metrics) {"soroban", "config", "bucket-list-target-size-byte"})) , mConfigFeeWrite1KB( metrics.NewCounter({"soroban", "config", "fee-write-1kb"})) + , mLedgerHostFnCpuInsnsRatio(metrics.NewHistogram( + {"soroban", "host-fn-op", "ledger-cpu-insns-ratio"})) + , mLedgerHostFnCpuInsnsRatioExclVm(metrics.NewHistogram( + {"soroban", "host-fn-op", "ledger-cpu-insns-ratio-excl-vm"})) { } +void +SorobanMetrics::accumulateModelledCpuInsns(uint64_t insnsCount, + uint64_t insnsExclVmCount, + uint64_t hostFnExecTimeNsecs) +{ + mLedgerInsnsCount += insnsCount; + mLedgerInsnsExclVmCount += insnsExclVmCount; + mLedgerHostFnExecTimeNsecs += hostFnExecTimeNsecs; +} + void SorobanMetrics::accumulateLedgerTxCount(uint64_t txCount) { @@ -177,6 +191,11 @@ SorobanMetrics::publishAndResetLedgerWideMetrics() mLedgerReadLedgerByte.Update(mCounterLedgerReadByte); mLedgerWriteEntry.Update(mCounterLedgerWriteEntry); mLedgerWriteLedgerByte.Update(mCounterLedgerWriteByte); + mLedgerHostFnCpuInsnsRatio.Update(mLedgerHostFnExecTimeNsecs * 1000000 / + std::max(mLedgerInsnsCount, uint64_t(1))); + mLedgerHostFnCpuInsnsRatioExclVm.Update( + mLedgerHostFnExecTimeNsecs * 1000000 / + std::max(mLedgerInsnsExclVmCount, uint64_t(1))); mCounterLedgerTxCount = 0; mCounterLedgerCpuInsn = 0; @@ -185,5 +204,8 @@ SorobanMetrics::publishAndResetLedgerWideMetrics() mCounterLedgerReadByte = 0; mCounterLedgerWriteEntry = 0; mCounterLedgerWriteByte = 0; + mLedgerHostFnExecTimeNsecs = 0; + mLedgerInsnsCount = 0; + mLedgerInsnsExclVmCount = 0; +} } -} \ No newline at end of file diff --git a/src/ledger/SorobanMetrics.h b/src/ledger/SorobanMetrics.h index 94c1bb5ce0..d0f2c84570 100644 --- a/src/ledger/SorobanMetrics.h +++ b/src/ledger/SorobanMetrics.h @@ -32,6 +32,10 @@ class SorobanMetrics uint64_t mCounterLedgerWriteEntry{0}; uint64_t mCounterLedgerWriteByte{0}; + uint64_t mLedgerInsnsCount{0}; + uint64_t mLedgerInsnsExclVmCount{0}; + uint64_t mLedgerHostFnExecTimeNsecs{0}; + public: // ledger-wide metrics medida::Histogram& mLedgerTxCount; @@ -41,6 +45,8 @@ class SorobanMetrics medida::Histogram& mLedgerReadLedgerByte; medida::Histogram& mLedgerWriteEntry; medida::Histogram& mLedgerWriteLedgerByte; + medida::Histogram& mLedgerHostFnCpuInsnsRatio; + medida::Histogram& mLedgerHostFnCpuInsnsRatioExclVm; // tx-wide metrics medida::Histogram& mTxSizeByte; @@ -106,6 +112,9 @@ class SorobanMetrics SorobanMetrics(medida::MetricsRegistry& metrics); + void accumulateModelledCpuInsns(uint64_t insnsCount, + uint64_t insnsExclVmCount, + uint64_t execTimeNsecs); void accumulateLedgerTxCount(uint64_t txCount); void accumulateLedgerCpuInsn(uint64_t cpuInsn); void accumulateLedgerTxsSizeByte(uint64_t txsSizeByte); diff --git a/src/main/CommandLine.cpp b/src/main/CommandLine.cpp index 51cbc4b814..c01005ce39 100644 --- a/src/main/CommandLine.cpp +++ b/src/main/CommandLine.cpp @@ -1884,6 +1884,10 @@ runApplyLoad(CommandLineArgs const& args) [&] { auto config = configOption.getConfig(); config.RUN_STANDALONE = true; + config.USE_CONFIG_FOR_GENESIS = true; + config.TESTING_UPGRADE_MAX_TX_SET_SIZE = 1000; + config.LEDGER_PROTOCOL_VERSION = + Config::CURRENT_LEDGER_PROTOCOL_VERSION; VirtualClock clock(VirtualClock::REAL_TIME); auto appPtr = Application::create(clock, config); @@ -1911,7 +1915,16 @@ runApplyLoad(CommandLineArgs const& args) "invoke-time-fsecs-cpu-insn-ratio-excl-vm"}); cpuInsRatioExclVm.Clear(); - for (size_t i = 0; i < 20; ++i) + auto& ledgerCpuInsRatio = app.getMetrics().NewHistogram( + {"soroban", "host-fn-op", "ledger-cpu-insns-ratio"}); + ledgerCpuInsRatio.Clear(); + + auto& ledgerCpuInsRatioExclVm = app.getMetrics().NewHistogram( + {"soroban", "host-fn-op", + "ledger-cpu-insns-ratio-excl-vm"}); + ledgerCpuInsRatioExclVm.Clear(); + + for (size_t i = 0; i < 100; ++i) { al.benchmark(); } @@ -1922,6 +1935,8 @@ runApplyLoad(CommandLineArgs const& args) ledgerClose.min()); CLOG_INFO(Perf, "Mean ledger close: {} milliseconds", ledgerClose.mean()); + CLOG_INFO(Perf, "stddev ledger close: {} milliseconds", + ledgerClose.std_dev()); CLOG_INFO(Perf, "Max CPU ins ratio: {}", cpuInsRatio.max() / 1000000); @@ -1932,6 +1947,24 @@ runApplyLoad(CommandLineArgs const& args) cpuInsRatioExclVm.max() / 1000000); CLOG_INFO(Perf, "Mean CPU ins ratio excl VM: {}", cpuInsRatioExclVm.mean() / 1000000); + CLOG_INFO(Perf, "stddev CPU ins ratio excl VM: {}", + cpuInsRatioExclVm.std_dev() / 1000000); + + CLOG_INFO(Perf, "Ledger Max CPU ins ratio: {}", + ledgerCpuInsRatio.max() / 1000000); + CLOG_INFO(Perf, "Ledger Mean CPU ins ratio: {}", + ledgerCpuInsRatio.mean() / 1000000); + CLOG_INFO(Perf, "Ledger stddev CPU ins ratio: {}", + ledgerCpuInsRatio.std_dev() / 1000000); + + CLOG_INFO(Perf, "Ledger Max CPU ins ratio excl VM: {}", + ledgerCpuInsRatioExclVm.max() / 1000000); + CLOG_INFO(Perf, "Ledger Mean CPU ins ratio excl VM: {}", + ledgerCpuInsRatioExclVm.mean() / 1000000); + CLOG_INFO( + Perf, + "Ledger stddev CPU ins ratio excl VM: {} milliseconds", + ledgerCpuInsRatioExclVm.std_dev() / 1000000); CLOG_INFO(Perf, "Tx count utilization {}%", al.getTxCountUtilization().mean() / 1000.0); diff --git a/src/simulation/ApplyLoad.cpp b/src/simulation/ApplyLoad.cpp index 0575886032..7b190a5365 100644 --- a/src/simulation/ApplyLoad.cpp +++ b/src/simulation/ApplyLoad.cpp @@ -61,9 +61,9 @@ ApplyLoad::ApplyLoad(Application& app, uint64_t ledgerMaxInstructions, mUpgradeConfig.ledgerMaxWriteLedgerEntries = ledgerMaxWriteLedgerEntries; mUpgradeConfig.ledgerMaxWriteBytes = ledgerMaxWriteBytes; mUpgradeConfig.ledgerMaxTxCount = ledgerMaxTxCount; - mUpgradeConfig.txMaxReadLedgerEntries = 40; + mUpgradeConfig.txMaxReadLedgerEntries = 100; mUpgradeConfig.txMaxReadBytes = 200000; - mUpgradeConfig.txMaxWriteLedgerEntries = 25; + mUpgradeConfig.txMaxWriteLedgerEntries = 50; mUpgradeConfig.txMaxWriteBytes = 66560; mUpgradeConfig.txMaxContractEventsSizeBytes = 8198; mUpgradeConfig.ledgerMaxTransactionsSizeBytes = @@ -97,9 +97,7 @@ ApplyLoad::closeLedger(std::vector const& txs, mApp.getHerder().makeStellarValue(txSet.first->getContentsHash(), 1, upgrades, mApp.getConfig().NODE_SEED); - auto& lm = mApp.getLedgerManager(); - LedgerCloseData lcd(lm.getLastClosedLedgerNum() + 1, txSet.first, sv); - lm.closeLedger(lcd); + stellar::txtest::closeLedger(mApp, txs, /* strictOrder */ false, upgrades); } void @@ -111,17 +109,18 @@ ApplyLoad::setupAccountsAndUpgradeProtocol() std::vector creationOps = mTxGenerator.createAccounts( 0, mNumAccounts, lm.getLastClosedLedgerNum() + 1, false); - auto initTx = mTxGenerator.createTransactionFramePtr(mRoot, creationOps, - false, std::nullopt); + for (size_t i = 0; i < creationOps.size(); i += MAX_OPS_PER_TX) + { + std::vector txs; - // Upgrade to latest protocol as well - auto upgrade = xdr::xvector{}; - auto ledgerUpgrade = LedgerUpgrade{LEDGER_UPGRADE_VERSION}; - ledgerUpgrade.newLedgerVersion() = Config::CURRENT_LEDGER_PROTOCOL_VERSION; - auto v = xdr::xdr_to_opaque(ledgerUpgrade); - upgrade.push_back(UpgradeType{v.begin(), v.end()}); + size_t end_id = std::min(i + MAX_OPS_PER_TX, creationOps.size()); + std::vector currOps(creationOps.begin() + i, + creationOps.begin() + end_id); + txs.push_back(mTxGenerator.createTransactionFramePtr( + mRoot, currOps, false, std::nullopt)); - closeLedger({initTx}, upgrade); + closeLedger(txs); + } } void @@ -137,10 +136,15 @@ ApplyLoad::setupUpgradeContract() mUpgradeCodeKey = contractCodeLedgerKey; + SorobanResources uploadResources; + uploadResources.instructions = 2'000'000; + uploadResources.readBytes = wasmBytes.size() + 500; + uploadResources.writeBytes = wasmBytes.size() + 500; + auto const& lm = mApp.getLedgerManager(); auto uploadTx = mTxGenerator.createUploadWasmTransaction( lm.getLastClosedLedgerNum() + 1, 0, wasmBytes, contractCodeLedgerKey, - std::nullopt); + std::nullopt, uploadResources); closeLedger({uploadTx.second}); @@ -153,6 +157,8 @@ ApplyLoad::setupUpgradeContract() mUpgradeInstanceKey = createTx.second->sorobanResources().footprint.readWrite.back(); + + releaseAssert(mTxGenerator.getApplySorobanSuccess().count() == 2); } // To upgrade settings, just modify mUpgradeConfig and then call @@ -164,9 +170,14 @@ ApplyLoad::upgradeSettings() auto upgradeBytes = mTxGenerator.getConfigUpgradeSetFromLoadConfig(mUpgradeConfig); + SorobanResources resources; + resources.instructions = 1'250'000; + resources.readBytes = 3'100; + resources.writeBytes = 3'100; + auto invokeTx = mTxGenerator.invokeSorobanCreateUpgradeTransaction( lm.getLastClosedLedgerNum() + 1, 0, upgradeBytes, mUpgradeCodeKey, - mUpgradeInstanceKey, std::nullopt); + mUpgradeInstanceKey, std::nullopt, resources); auto upgradeSetKey = mTxGenerator.getConfigUpgradeSetKey( mUpgradeConfig, @@ -365,4 +376,4 @@ ApplyLoad::getWriteEntryUtilization() return mWriteEntryUtilization; } -} \ No newline at end of file +} diff --git a/src/simulation/TxGenerator.cpp b/src/simulation/TxGenerator.cpp index d07380f64d..b5e938baa3 100644 --- a/src/simulation/TxGenerator.cpp +++ b/src/simulation/TxGenerator.cpp @@ -268,14 +268,18 @@ std::pair TxGenerator::createUploadWasmTransaction( uint32_t ledgerNum, uint64_t accountId, xdr::opaque_vec<> const& wasm, LedgerKey const& contractCodeLedgerKey, - std::optional maxGeneratedFeeRate) + std::optional maxGeneratedFeeRate, + std::optional uploadResources) { auto account = findAccount(accountId, ledgerNum); - SorobanResources uploadResources{}; - uploadResources.instructions = 2'500'000; - uploadResources.readBytes = wasm.size() + 500; - uploadResources.writeBytes = wasm.size() + 500; + if (!uploadResources) + { + uploadResources = SorobanResources{}; + uploadResources->instructions = 2'500'000; + uploadResources->readBytes = wasm.size() + 500; + uploadResources->writeBytes = wasm.size() + 500; + } Operation uploadOp; uploadOp.body.type(INVOKE_HOST_FUNCTION); @@ -283,13 +287,13 @@ TxGenerator::createUploadWasmTransaction( uploadHF.type(HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM); uploadHF.wasm() = wasm; - uploadResources.footprint.readWrite = {contractCodeLedgerKey}; + uploadResources->footprint.readWrite = {contractCodeLedgerKey}; int64_t resourceFee = - sorobanResourceFee(mApp, uploadResources, 5000 + wasm.size(), 100); + sorobanResourceFee(mApp, *uploadResources, 5000 + wasm.size(), 100); resourceFee += 1'000'000; auto tx = sorobanTransactionFrameFromOps(mApp.getNetworkID(), *account, - {uploadOp}, {}, uploadResources, + {uploadOp}, {}, *uploadResources, generateFee(maxGeneratedFeeRate, /* opsCnt */ 1), resourceFee); @@ -373,7 +377,7 @@ TxGenerator::invokeSorobanLoadTransaction( uint64_t const instructionsPerHostCycle = 5030; // Very rough estimates. - uint64_t const instructionsPerKbWritten = 8000; + uint64_t const instructionsPerKbWritten = 50000; // instructionsPerPaddingByte is just a value we know works. We use an auth // payload as padding, so it consumes instructions on the host side. @@ -767,7 +771,8 @@ std::pair TxGenerator::invokeSorobanCreateUpgradeTransaction( uint32_t ledgerNum, uint64_t accountId, SCBytes const& upgradeBytes, LedgerKey const& codeKey, LedgerKey const& instanceKey, - std::optional maxGeneratedFeeRate) + std::optional maxGeneratedFeeRate, + std::optional resources) { auto account = findAccount(accountId, ledgerNum); auto const& contractID = instanceKey.contractData().contract; @@ -785,12 +790,16 @@ TxGenerator::invokeSorobanCreateUpgradeTransaction( upgradeSetKey.contentHash = upgradeHash; upgradeSetKey.contractID = contractID.contractId(); - SorobanResources resources; - resources.footprint.readOnly = {instanceKey, codeKey}; - resources.footprint.readWrite = {upgradeLK}; - resources.instructions = 2'500'000; - resources.readBytes = 3'100; - resources.writeBytes = 3'100; + if (!resources) + { + resources = SorobanResources{}; + resources->instructions = 2'500'000; + resources->readBytes = 3'100; + resources->writeBytes = 3'100; + } + + resources->footprint.readOnly = {instanceKey, codeKey}; + resources->footprint.readWrite = {upgradeLK}; SCVal b(SCV_BYTES); b.bytes() = upgradeBytes; @@ -803,11 +812,11 @@ TxGenerator::invokeSorobanCreateUpgradeTransaction( ihf.invokeContract().functionName = "write"; ihf.invokeContract().args.emplace_back(b); - auto resourceFee = sorobanResourceFee(mApp, resources, 1'000, 40); + auto resourceFee = sorobanResourceFee(mApp, *resources, 1'000, 40); resourceFee += 1'000'000; auto tx = sorobanTransactionFrameFromOps(mApp.getNetworkID(), *account, - {op}, {}, resources, + {op}, {}, *resources, generateFee(maxGeneratedFeeRate, /* opsCnt */ 1), resourceFee); diff --git a/src/simulation/TxGenerator.h b/src/simulation/TxGenerator.h index 4ae04c6a09..ed21ab0dec 100644 --- a/src/simulation/TxGenerator.h +++ b/src/simulation/TxGenerator.h @@ -93,10 +93,11 @@ class TxGenerator std::optional maxGeneratedFeeRate); std::pair - createUploadWasmTransaction(uint32_t ledgerNum, uint64_t accountId, - xdr::opaque_vec<> const& wasm, - LedgerKey const& contractCodeLedgerKey, - std::optional maxGeneratedFeeRate); + createUploadWasmTransaction( + uint32_t ledgerNum, uint64_t accountId, xdr::opaque_vec<> const& wasm, + LedgerKey const& contractCodeLedgerKey, + std::optional maxGeneratedFeeRate, + std::optional resources = std::nullopt); std::pair createContractTransaction(uint32_t ledgerNum, uint64_t accountId, LedgerKey const& codeKey, @@ -113,7 +114,8 @@ class TxGenerator invokeSorobanCreateUpgradeTransaction( uint32_t ledgerNum, uint64_t accountId, SCBytes const& upgradeBytes, LedgerKey const& codeKey, LedgerKey const& instanceKey, - std::optional maxGeneratedFeeRate); + std::optional maxGeneratedFeeRate, + std::optional resources = std::nullopt); std::pair sorobanRandomWasmTransaction(uint32_t ledgerNum, uint64_t accountId, uint32_t inclusionFee); diff --git a/src/simulation/test/LoadGeneratorTests.cpp b/src/simulation/test/LoadGeneratorTests.cpp index fd31de9b05..b488fbaf8e 100644 --- a/src/simulation/test/LoadGeneratorTests.cpp +++ b/src/simulation/test/LoadGeneratorTests.cpp @@ -4,9 +4,11 @@ #include "crypto/SHA.h" #include "crypto/SecretKey.h" +#include "ledger/LedgerManager.h" #include "lib/catch.hpp" #include "main/Config.h" #include "scp/QuorumSetUtils.h" +#include "simulation/ApplyLoad.h" #include "simulation/LoadGenerator.h" #include "simulation/Topologies.h" #include "test/test.h" @@ -820,3 +822,86 @@ TEST_CASE("Upgrade setup with metrics reset", "[loadgen]") 5 * Herder::EXP_LEDGER_TIMESPAN_SECONDS, false); REQUIRE(runsFailed.count() == 0); } + +TEST_CASE("apply load", "[loadgen][applyload]") +{ + auto cfg = getTestConfig(); + cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 1000; + cfg.USE_CONFIG_FOR_GENESIS = true; + cfg.LEDGER_PROTOCOL_VERSION = Config::CURRENT_LEDGER_PROTOCOL_VERSION; + + cfg.LOADGEN_NUM_DATA_ENTRIES_FOR_TESTING = {5, 10, 30}; + cfg.LOADGEN_NUM_DATA_ENTRIES_DISTRIBUTION_FOR_TESTING = {1, 1, 1}; + cfg.LOADGEN_IO_KILOBYTES_FOR_TESTING = {1, 5, 10}; + cfg.LOADGEN_IO_KILOBYTES_DISTRIBUTION_FOR_TESTING = {10, 2, 1}; + cfg.LOADGEN_TX_SIZE_BYTES_FOR_TESTING = {1'000, 2'000, 5'000}; + cfg.LOADGEN_TX_SIZE_BYTES_DISTRIBUTION_FOR_TESTING = {3, 2, 1}; + cfg.LOADGEN_INSTRUCTIONS_FOR_TESTING = {10'000'000, 50'000'000}; + cfg.LOADGEN_INSTRUCTIONS_DISTRIBUTION_FOR_TESTING = {5, 1}; + + REQUIRE(cfg.isUsingBucketListDB()); + + VirtualClock clock(VirtualClock::REAL_TIME); + auto app = createTestApplication(clock, cfg); + auto const& lm = app->getLedgerManager(); + + uint64_t ledgerMaxInstructions = 500'000'000; + uint64_t ledgerMaxReadLedgerEntries = 2000; + uint64_t ledgerMaxReadBytes = 50'000'000; + uint64_t ledgerMaxWriteLedgerEntries = 1250; + uint64_t ledgerMaxWriteBytes = 700'000; + uint64_t ledgerMaxTxCount = 50; + uint64_t ledgerMaxTransactionsSizeBytes = 800'000; + + ApplyLoad al(*app, ledgerMaxInstructions, ledgerMaxReadLedgerEntries, + ledgerMaxReadBytes, ledgerMaxWriteLedgerEntries, + ledgerMaxWriteBytes, ledgerMaxTxCount, + ledgerMaxTransactionsSizeBytes); + + auto& ledgerClose = + app->getMetrics().NewTimer({"ledger", "ledger", "close"}); + ledgerClose.Clear(); + + auto& cpuInsRatio = app->getMetrics().NewHistogram( + {"soroban", "host-fn-op", "invoke-time-fsecs-cpu-insn-ratio"}); + cpuInsRatio.Clear(); + + auto& cpuInsRatioExclVm = app->getMetrics().NewHistogram( + {"soroban", "host-fn-op", "invoke-time-fsecs-cpu-insn-ratio-excl-vm"}); + cpuInsRatioExclVm.Clear(); + for (size_t i = 0; i < 100; ++i) + { + al.benchmark(); + } + REQUIRE(al.successRate() - 1.0 < std::numeric_limits::epsilon()); + CLOG_INFO(Perf, "Max ledger close: {} milliseconds", ledgerClose.max()); + CLOG_INFO(Perf, "Min ledger close: {} milliseconds", ledgerClose.min()); + CLOG_INFO(Perf, "Mean ledger close: {} milliseconds", ledgerClose.mean()); + CLOG_INFO(Perf, "stddev ledger close: {} milliseconds", + ledgerClose.std_dev()); + + CLOG_INFO(Perf, "Max CPU ins ratio: {}", cpuInsRatio.max() / 1000000); + CLOG_INFO(Perf, "Mean CPU ins ratio: {}", cpuInsRatio.mean() / 1000000); + + CLOG_INFO(Perf, "Max CPU ins ratio excl VM: {}", + cpuInsRatioExclVm.max() / 1000000); + CLOG_INFO(Perf, "Mean CPU ins ratio excl VM: {}", + cpuInsRatioExclVm.mean() / 1000000); + CLOG_INFO(Perf, "STDDEV CPU ins ratio excl VM: {}", + cpuInsRatioExclVm.std_dev() / 1000000); + + CLOG_INFO(Perf, "Tx count utilization {}%", + al.getTxCountUtilization().mean() / 1000.0); + CLOG_INFO(Perf, "Instruction utilization {}%", + al.getInstructionUtilization().mean() / 1000.0); + CLOG_INFO(Perf, "Tx size utilization {}%", + al.getTxSizeUtilization().mean() / 1000.0); + CLOG_INFO(Perf, "Read bytes utilization {}%", + al.getReadByteUtilization().mean() / 1000.0); + CLOG_INFO(Perf, "Write bytes utilization {}%", + al.getWriteByteUtilization().mean() / 1000.0); + CLOG_INFO(Perf, "Read entry utilization {}%", + al.getReadEntryUtilization().mean() / 1000.0); + CLOG_INFO(Perf, "Write entry utilization {}%", + al.getWriteEntryUtilization().mean() / 1000.0); +} diff --git a/src/test/TxTests.cpp b/src/test/TxTests.cpp index 09f3ae5e25..b9a69a8f1b 100644 --- a/src/test/TxTests.cpp +++ b/src/test/TxTests.cpp @@ -561,11 +561,11 @@ closeLedgerOn(Application& app, uint32 ledgerSeq, TimePoint closeTime, // `strictOrder` means the txs in the txSet will be applied in the exact // same order as they were constructed. It could also imply the txs // themselves maybe intentionally invalid for testing purpose. - REQUIRE(txSet.second->checkValid(app, 0, 0)); + releaseAssert(txSet.second->checkValid(app, 0, 0)); } app.getHerder().externalizeValue(txSet.first, ledgerSeq, closeTime, upgrades); - REQUIRE(app.getLedgerManager().getLastClosedLedgerNum() == ledgerSeq); + releaseAssert(app.getLedgerManager().getLastClosedLedgerNum() == ledgerSeq); auto& lm = static_cast(app.getLedgerManager()); return lm.mLatestTxResultSet; } diff --git a/src/transactions/InvokeHostFunctionOpFrame.cpp b/src/transactions/InvokeHostFunctionOpFrame.cpp index 20f39c7f27..28a6ec1f83 100644 --- a/src/transactions/InvokeHostFunctionOpFrame.cpp +++ b/src/transactions/InvokeHostFunctionOpFrame.cpp @@ -219,6 +219,9 @@ struct HostFunctionMetrics mMetrics.mHostFnOpMaxRwCodeByte.Mark(mMaxReadWriteCodeByte); mMetrics.mHostFnOpMaxEmitEventByte.Mark(mMaxEmitEventByte); + mMetrics.accumulateModelledCpuInsns(mCpuInsn, mCpuInsnExclVm, + mInvokeTimeNsecs); + if (mSuccess) { mMetrics.mHostFnOpSuccess.Mark(); From cb2564955df2b8c0db476ec492d6e107762dbb94 Mon Sep 17 00:00:00 2001 From: Dmytro Kozhevin Date: Thu, 31 Oct 2024 16:36:13 -0400 Subject: [PATCH 2/4] Update `upgradeSorobanNetworkConfig` utility with higher timeout (as it randomly broke the externalize test). Also update the externalize test itself to cover the relevant protocol versions (prev and curr) instead of some fixed ones. --- src/herder/test/HerderTests.cpp | 9 +++++---- src/test/TestUtils.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/herder/test/HerderTests.cpp b/src/herder/test/HerderTests.cpp index 809a0159cc..acdf87a2a7 100644 --- a/src/herder/test/HerderTests.cpp +++ b/src/herder/test/HerderTests.cpp @@ -4147,14 +4147,15 @@ herderExternalizesValuesWithProtocol(uint32_t version) TEST_CASE("herder externalizes values", "[herder]") { - SECTION("v19") + SECTION("prev protocol") { - herderExternalizesValuesWithProtocol(19); + herderExternalizesValuesWithProtocol( + Config::CURRENT_LEDGER_PROTOCOL_VERSION - 1); } - SECTION("soroban") + SECTION("curr protocol") { herderExternalizesValuesWithProtocol( - static_cast(SOROBAN_PROTOCOL_VERSION)); + Config::CURRENT_LEDGER_PROTOCOL_VERSION); } } diff --git a/src/test/TestUtils.cpp b/src/test/TestUtils.cpp index 7750fe345a..cd5f655f77 100644 --- a/src/test/TestUtils.cpp +++ b/src/test/TestUtils.cpp @@ -246,7 +246,7 @@ upgradeSorobanNetworkConfig(std::function modifyFn, completeCount = complete.count(); simulation->crankUntil( [&]() { return complete.count() == completeCount + 1; }, - 2 * Herder::EXP_LEDGER_TIMESPAN_SECONDS, false); + 4 * Herder::EXP_LEDGER_TIMESPAN_SECONDS, false); // Arm for upgrade. for (auto app : nodes) From 9359ad3ef8e7f64e93e30e616615c0f88c0a39c7 Mon Sep 17 00:00:00 2001 From: Dmytro Kozhevin Date: Thu, 31 Oct 2024 22:16:37 -0400 Subject: [PATCH 3/4] Regenerate LCM. The reason for the change is the added costs recalibration. This also led to a host fn succeeding instead of failing. --- ...ger-close-meta-v1-protocol-20-soroban.json | 84 +- .../ledger-close-meta-v1-protocol-20.json | 12 +- ...ger-close-meta-v1-protocol-21-soroban.json | 462 +++++----- .../ledger-close-meta-v1-protocol-21.json | 12 +- ...ger-close-meta-v1-protocol-22-soroban.json | 448 +++++----- .../ledger-close-meta-v1-protocol-22.json | 12 +- ...ger-close-meta-v1-protocol-23-soroban.json | 12 +- .../ledger-close-meta-v1-protocol-23.json | 818 +++++++++--------- 8 files changed, 984 insertions(+), 876 deletions(-) diff --git a/src/testdata/ledger-close-meta-v1-protocol-20-soroban.json b/src/testdata/ledger-close-meta-v1-protocol-20-soroban.json index 3fb940422c..8df30dfc46 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-20-soroban.json +++ b/src/testdata/ledger-close-meta-v1-protocol-20-soroban.json @@ -6,27 +6,27 @@ "v": 0 }, "ledgerHeader": { - "hash": "210017b4a10cb50a87b379056143a1b34639d11832ead16ae73aa07da4b2f7c5", + "hash": "8a3ac41231de9959e976c4fa538e8b95c25aa46ef2917db734a07812d87a61c1", "header": { "ledgerVersion": 20, - "previousLedgerHash": "fa06ded1022887f708dfc430803f5c4ed307ae4ff08dc266f10d84a284d0d2a0", + "previousLedgerHash": "2da76fd7a7f80699e319c7e90d669485a49c8e15839b8d52a1543504b2cfa5af", "scpValue": { - "txSetHash": "b73ddb76d75b2a874252654c440e536df9b672142d0b6322334b52ce01e481b5", + "txSetHash": "a67f3dc3307061e8ef92cea9ad7b406b158d52bf6583b9e618bd49a24a337b55", "closeTime": 1451692800, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "58ce66cce7893b2764555a9afd77967e9d5b7adf08cc0a9e9a60f4f83db4ad6681bb3dec1cafd8ae5d4eb6e0a838d536fa736432f2fa2fb7af0eb6f89a9ef80a" + "signature": "04a835e9de30e03d5ebb4a7028fa6fe00f1a2a72790173ad26da554450284a6ee1b013314560e087e45d8d6beb16e318ee7b7a5ddcd5de7ea98f9e8463010302" } } }, - "txSetResultHash": "b3f37714ac4cb6c4afcffb6ea20691b27294e8dc6abdcca96eba2baea8fce8df", - "bucketListHash": "301b92a2e5a5f0c946a9804fbb62e3298f3fd2716182531d8dd7c16b42d2281f", + "txSetResultHash": "64bed80df9936935fb9b1a87e93509753cfa3ccb8c37d86a2d82f93f268a8f42", + "bucketListHash": "f1bceb5934afbb9151614f61a1b4cadd5175dd8589daf6ab62444e458dd0a6c5", "ledgerSeq": 28, "totalCoins": 1000000000000000000, - "feePool": 687415, + "feePool": 707471, "inflationSeq": 0, "idPool": 0, "baseFee": 100, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "fa06ded1022887f708dfc430803f5c4ed307ae4ff08dc266f10d84a284d0d2a0", + "previousLedgerHash": "2da76fd7a7f80699e319c7e90d669485a49c8e15839b8d52a1543504b2cfa5af", "phases": [ { "v": 0, @@ -1495,16 +1495,17 @@ "result": { "transactionHash": "1dd58e08056b81c30a5dd17447a2c0b449f15fca73d7e8fbdacb0c58189581c3", "result": { - "feeCharged": 42946, + "feeCharged": 63002, "result": { - "code": "txFAILED", + "code": "txSUCCESS", "results": [ { "code": "opINNER", "tr": { "type": "INVOKE_HOST_FUNCTION", "invokeHostFunctionResult": { - "code": "INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED" + "code": "INVOKE_HOST_FUNCTION_SUCCESS", + "success": "c941f2e98c008dadb59ca9f1c5da74b9e4492505c195891e97f9251df6fa8f5c" } } } @@ -1653,7 +1654,60 @@ } } ], - "operations": [], + "operations": [ + { + "changes": [ + { + "type": "LEDGER_ENTRY_CREATED", + "created": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "CONTRACT_DATA", + "contractData": { + "ext": { + "v": 0 + }, + "contract": "CCOKSYPZJ2B3244CEMLBGUGWPMQ3BLES6AKHRQCX2XF27K4HDBW2LKDF", + "key": { + "type": "SCV_LEDGER_KEY_CONTRACT_INSTANCE" + }, + "durability": "PERSISTENT", + "val": { + "type": "SCV_CONTRACT_INSTANCE", + "instance": { + "executable": { + "type": "CONTRACT_EXECUTABLE_WASM", + "wasm_hash": "fc644715caaead746e6145f4331ff75c427c965c20d2995a9942b01247515962" + }, + "storage": null + } + } + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_CREATED", + "created": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "c92299f9bdb7a8e6c53092d8f64b92f726eaec5a700608adc80c55ad7824f637", + "liveUntilLedgerSeq": 47 + } + }, + "ext": { + "v": 0 + } + } + } + ] + } + ], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -1713,7 +1767,7 @@ "type": "ACCOUNT", "account": { "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 399957054, + "balance": 399936998, "seqNum": 51539607553, "numSubEntries": 0, "inflationDest": null, @@ -1762,8 +1816,8 @@ }, "events": [], "returnValue": { - "type": "SCV_BOOL", - "b": "FALSE" + "type": "SCV_ADDRESS", + "address": "CCOKSYPZJ2B3244CEMLBGUGWPMQ3BLES6AKHRQCX2XF27K4HDBW2LKDF" }, "diagnosticEvents": [] } diff --git a/src/testdata/ledger-close-meta-v1-protocol-20.json b/src/testdata/ledger-close-meta-v1-protocol-20.json index cbc73b1297..046b649d36 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-20.json +++ b/src/testdata/ledger-close-meta-v1-protocol-20.json @@ -6,24 +6,24 @@ "v": 0 }, "ledgerHeader": { - "hash": "26e7920e014e57fc78ee8156d028ac618573034111c6387ccf3cd08de506071f", + "hash": "a50c06f398679584d4acff68de5130502114df913f41c270a4bce9e1d6cd5c36", "header": { "ledgerVersion": 20, - "previousLedgerHash": "15a912e7b36da55ab1d1f6735e0a8dd659876d97d9231fc48e31bebb0819a456", + "previousLedgerHash": "ab3ae955a234c8b03bbd42f5a7ba9b98989ea9fa6e380b00d9bb47abc11fd9f7", "scpValue": { - "txSetHash": "163a70a902ab200e527ad7bd92678c11591333cfe6f6258985f2d4ba98235961", + "txSetHash": "748fee17bde220a1e44a917ac6ae9cf70bedb749bc2a2bf440fffbe04d7a46cf", "closeTime": 0, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "b05f325722618b96b61fab772c6446cc50c504b3394e0991fa3a574564d14fa05fb420a1a97897af50fbdb82f906580616171c7071ef9b61a3dc482365d1560e" + "signature": "db221f42903acae8fa8f38251516df81257687c301729f00fe8c9f377af298181a8f18b9b5a690f3c6c05f8fe168c30081d1ad0c4b8dcbd34f194300e9aa830a" } } }, "txSetResultHash": "249b974bacf8b5c4a8f0b5598194c1b9eca64af0b5c1506daa871c1533b6baac", - "bucketListHash": "41e6f842778e7b6b81576c29fefc222c5ff909241a3fcf7503ed3322222b92b5", + "bucketListHash": "7c28bf01c1eb9bf17fae213218f9cffeea048d5b261b57bb1092ee39a3afe1c3", "ledgerSeq": 7, "totalCoins": 1000000000000000000, "feePool": 800, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "15a912e7b36da55ab1d1f6735e0a8dd659876d97d9231fc48e31bebb0819a456", + "previousLedgerHash": "ab3ae955a234c8b03bbd42f5a7ba9b98989ea9fa6e380b00d9bb47abc11fd9f7", "phases": [ { "v": 0, diff --git a/src/testdata/ledger-close-meta-v1-protocol-21-soroban.json b/src/testdata/ledger-close-meta-v1-protocol-21-soroban.json index 7df7f8bff4..a1bd3489f8 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-21-soroban.json +++ b/src/testdata/ledger-close-meta-v1-protocol-21-soroban.json @@ -6,27 +6,27 @@ "v": 0 }, "ledgerHeader": { - "hash": "04327bd8295625131efb5187393adfe5c3b1f7b8c7a969bcee3dbaaa5631337d", + "hash": "b035272359665589c4322c1b413e20d299ba265bc6f5e731377fa18384317310", "header": { "ledgerVersion": 21, - "previousLedgerHash": "42c22b6b9c800df6183be351519ac8f21b9e5bc13bd1685ed4b16aaa7c789ce5", + "previousLedgerHash": "ec2afa4cc77b71b3a29607398e88c815e92aad31a774f392ef607085e6b7810a", "scpValue": { - "txSetHash": "a6bf73dfb9ff963863cf6088117b08e16e843bb4af91f9bca79cba90c81ba6e9", + "txSetHash": "3dce72d58747e23e43e281c452054d691e34e89789854c84b46955ed3a8abb06", "closeTime": 1451692800, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "32b86b9add640e66f4de94109e7fabb231898872fd56761c37e51ab5eb47165642c341370e721d7f1edcc30e2b547d930818207116d1ffb1a04b03b16e47a50b" + "signature": "f322d9b516e460765467803b2189c657de06f4e3d86a8d6407bde27d79b30524598bedfcb8c8dd6007f2e78a06b0145131cb8664ca7974f3c60b69600b9fa80c" } } }, - "txSetResultHash": "b3f37714ac4cb6c4afcffb6ea20691b27294e8dc6abdcca96eba2baea8fce8df", - "bucketListHash": "c64489785f019f5585c180624a94e4a2df437bfa8a4837e9da9e80885509a032", + "txSetResultHash": "031c6b99c69184bd482690d61207d2de747424cead7ac1a9c403d4e2a2587ba3", + "bucketListHash": "fc22437bfd6c5ed931f87dadb8500bb15dd11a5db214fe00014d1e6f55b2e8b8", "ledgerSeq": 28, "totalCoins": 1000000000000000000, - "feePool": 804504, + "feePool": 824560, "inflationSeq": 0, "idPool": 0, "baseFee": 100, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "42c22b6b9c800df6183be351519ac8f21b9e5bc13bd1685ed4b16aaa7c789ce5", + "previousLedgerHash": "ec2afa4cc77b71b3a29607398e88c815e92aad31a774f392ef607085e6b7810a", "phases": [ { "v": 0, @@ -502,9 +502,9 @@ "txProcessing": [ { "result": { - "transactionHash": "e310227a8c0d8d1f78632e65ebca281cd60d8619c9afc64491bcce98e7cd7ee3", + "transactionHash": "1dd58e08056b81c30a5dd17447a2c0b449f15fca73d7e8fbdacb0c58189581c3", "result": { - "feeCharged": 106775, + "feeCharged": 63002, "result": { "code": "txSUCCESS", "results": [ @@ -514,7 +514,7 @@ "type": "INVOKE_HOST_FUNCTION", "invokeHostFunctionResult": { "code": "INVOKE_HOST_FUNCTION_SUCCESS", - "success": "cbbc48750debb8535093b3deaf88ac7f4cff87425576a58de2bac754acdb4616" + "success": "c941f2e98c008dadb59ca9f1c5da74b9e4492505c195891e97f9251df6fa8f5c" } } } @@ -529,13 +529,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 10, + "lastModifiedLedgerSeq": 12, "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", "balance": 400000000, - "seqNum": 42949672960, + "seqNum": 51539607552, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -559,9 +559,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672960, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607552, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -593,9 +593,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672960, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607552, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -619,9 +619,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672961, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607553, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -676,15 +676,20 @@ "ext": { "v": 0 }, - "contract": "CAA3QKIP2SNVXUJTB4HKOGF55JTSSMQGED3FZYNHMNSXYV3DRRMAWA3Y", + "contract": "CCOKSYPZJ2B3244CEMLBGUGWPMQ3BLES6AKHRQCX2XF27K4HDBW2LKDF", "key": { - "type": "SCV_SYMBOL", - "sym": "key" + "type": "SCV_LEDGER_KEY_CONTRACT_INSTANCE" }, "durability": "PERSISTENT", "val": { - "type": "SCV_U64", - "u64": 42 + "type": "SCV_CONTRACT_INSTANCE", + "instance": { + "executable": { + "type": "CONTRACT_EXECUTABLE_WASM", + "wasm_hash": "fc644715caaead746e6145f4331ff75c427c965c20d2995a9942b01247515962" + }, + "storage": null + } } } }, @@ -700,7 +705,7 @@ "data": { "type": "TTL", "ttl": { - "keyHash": "764f4e59e20ac1a357f9f26ab0eaf46d196ab74822db44f039353a6f114864aa", + "keyHash": "c92299f9bdb7a8e6c53092d8f64b92f726eaec5a700608adc80c55ad7824f637", "liveUntilLedgerSeq": 47 } }, @@ -720,9 +725,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672961, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607553, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -770,9 +775,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399893225, - "seqNum": 42949672961, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 399936998, + "seqNum": 51539607553, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -820,7 +825,8 @@ }, "events": [], "returnValue": { - "type": "SCV_VOID" + "type": "SCV_ADDRESS", + "address": "CCOKSYPZJ2B3244CEMLBGUGWPMQ3BLES6AKHRQCX2XF27K4HDBW2LKDF" }, "diagnosticEvents": [] } @@ -829,18 +835,18 @@ }, { "result": { - "transactionHash": "364ec41dce0a678476ea3ebfc5caa28165ef3bf0976071d858b1c4044f187d25", + "transactionHash": "bb0a6b13caea6b015555dfd332aca1099e8654896bf7d1bcce8432e833a2572a", "result": { - "feeCharged": 60559, + "feeCharged": 61612, "result": { - "code": "txSUCCESS", + "code": "txFAILED", "results": [ { "code": "opINNER", "tr": { - "type": "EXTEND_FOOTPRINT_TTL", - "extendFootprintTTLResult": { - "code": "EXTEND_FOOTPRINT_TTL_SUCCESS" + "type": "INVOKE_HOST_FUNCTION", + "invokeHostFunctionResult": { + "code": "INVOKE_HOST_FUNCTION_TRAPPED" } } } @@ -855,13 +861,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 9, + "lastModifiedLedgerSeq": 11, "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", "balance": 400000000, - "seqNum": 38654705664, + "seqNum": 47244640256, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -885,9 +891,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705664, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640256, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -919,9 +925,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705664, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640256, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -945,9 +951,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705665, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640257, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -989,76 +995,7 @@ } } ], - "operations": [ - { - "changes": [ - { - "type": "LEDGER_ENTRY_STATE", - "state": { - "lastModifiedLedgerSeq": 6, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", - "liveUntilLedgerSeq": 10006 - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_UPDATED", - "updated": { - "lastModifiedLedgerSeq": 28, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", - "liveUntilLedgerSeq": 10028 - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_STATE", - "state": { - "lastModifiedLedgerSeq": 6, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", - "liveUntilLedgerSeq": 10006 - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_UPDATED", - "updated": { - "lastModifiedLedgerSeq": 28, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", - "liveUntilLedgerSeq": 10028 - } - }, - "ext": { - "v": 0 - } - } - } - ] - } - ], + "operations": [], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -1067,9 +1004,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705665, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640257, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1117,9 +1054,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 399939441, - "seqNum": 38654705665, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399938388, + "seqNum": 47244640257, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1177,18 +1114,18 @@ }, { "result": { - "transactionHash": "ee68d27257fa137933de22b3fdfbc4a736ec01af29a9e25e5b807252b1a1ca0a", + "transactionHash": "364ec41dce0a678476ea3ebfc5caa28165ef3bf0976071d858b1c4044f187d25", "result": { - "feeCharged": 51547, + "feeCharged": 60559, "result": { "code": "txSUCCESS", "results": [ { "code": "opINNER", "tr": { - "type": "RESTORE_FOOTPRINT", - "restoreFootprintResult": { - "code": "RESTORE_FOOTPRINT_SUCCESS" + "type": "EXTEND_FOOTPRINT_TTL", + "extendFootprintTTLResult": { + "code": "EXTEND_FOOTPRINT_TTL_SUCCESS" } } } @@ -1203,13 +1140,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 8, + "lastModifiedLedgerSeq": 9, "data": { "type": "ACCOUNT", "account": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", "balance": 400000000, - "seqNum": 34359738368, + "seqNum": 38654705664, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1233,9 +1170,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", "balance": 398999900, - "seqNum": 34359738368, + "seqNum": 38654705664, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1267,9 +1204,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", "balance": 398999900, - "seqNum": 34359738368, + "seqNum": 38654705664, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1293,9 +1230,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", "balance": 398999900, - "seqNum": 34359738369, + "seqNum": 38654705665, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1343,12 +1280,12 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 7, + "lastModifiedLedgerSeq": 6, "data": { "type": "TTL", "ttl": { - "keyHash": "4791962cd1e2c7b8f8af3f96514f9777f0156a48261fb885a571a7f69b33a058", - "liveUntilLedgerSeq": 26 + "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", + "liveUntilLedgerSeq": 10006 } }, "ext": { @@ -1363,8 +1300,40 @@ "data": { "type": "TTL", "ttl": { - "keyHash": "4791962cd1e2c7b8f8af3f96514f9777f0156a48261fb885a571a7f69b33a058", - "liveUntilLedgerSeq": 47 + "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", + "liveUntilLedgerSeq": 10028 + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_STATE", + "state": { + "lastModifiedLedgerSeq": 6, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", + "liveUntilLedgerSeq": 10006 + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_UPDATED", + "updated": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", + "liveUntilLedgerSeq": 10028 } }, "ext": { @@ -1383,9 +1352,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", "balance": 398999900, - "seqNum": 34359738369, + "seqNum": 38654705665, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1433,9 +1402,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", - "balance": 399948453, - "seqNum": 34359738369, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 399939441, + "seqNum": 38654705665, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1493,18 +1462,19 @@ }, { "result": { - "transactionHash": "1dd58e08056b81c30a5dd17447a2c0b449f15fca73d7e8fbdacb0c58189581c3", + "transactionHash": "e310227a8c0d8d1f78632e65ebca281cd60d8619c9afc64491bcce98e7cd7ee3", "result": { - "feeCharged": 42946, + "feeCharged": 106775, "result": { - "code": "txFAILED", + "code": "txSUCCESS", "results": [ { "code": "opINNER", "tr": { "type": "INVOKE_HOST_FUNCTION", "invokeHostFunctionResult": { - "code": "INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED" + "code": "INVOKE_HOST_FUNCTION_SUCCESS", + "success": "cbbc48750debb8535093b3deaf88ac7f4cff87425576a58de2bac754acdb4616" } } } @@ -1519,13 +1489,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 12, + "lastModifiedLedgerSeq": 10, "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", "balance": 400000000, - "seqNum": 51539607552, + "seqNum": 42949672960, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1549,9 +1519,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607552, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672960, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1583,9 +1553,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607552, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672960, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1609,9 +1579,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607553, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672961, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1653,7 +1623,55 @@ } } ], - "operations": [], + "operations": [ + { + "changes": [ + { + "type": "LEDGER_ENTRY_CREATED", + "created": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "CONTRACT_DATA", + "contractData": { + "ext": { + "v": 0 + }, + "contract": "CAA3QKIP2SNVXUJTB4HKOGF55JTSSMQGED3FZYNHMNSXYV3DRRMAWA3Y", + "key": { + "type": "SCV_SYMBOL", + "sym": "key" + }, + "durability": "PERSISTENT", + "val": { + "type": "SCV_U64", + "u64": 42 + } + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_CREATED", + "created": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "764f4e59e20ac1a357f9f26ab0eaf46d196ab74822db44f039353a6f114864aa", + "liveUntilLedgerSeq": 47 + } + }, + "ext": { + "v": 0 + } + } + } + ] + } + ], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -1662,9 +1680,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607553, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672961, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1712,9 +1730,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 399957054, - "seqNum": 51539607553, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399893225, + "seqNum": 42949672961, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1762,8 +1780,7 @@ }, "events": [], "returnValue": { - "type": "SCV_BOOL", - "b": "FALSE" + "type": "SCV_VOID" }, "diagnosticEvents": [] } @@ -1772,18 +1789,18 @@ }, { "result": { - "transactionHash": "bb0a6b13caea6b015555dfd332aca1099e8654896bf7d1bcce8432e833a2572a", + "transactionHash": "ee68d27257fa137933de22b3fdfbc4a736ec01af29a9e25e5b807252b1a1ca0a", "result": { - "feeCharged": 61612, + "feeCharged": 51547, "result": { - "code": "txFAILED", + "code": "txSUCCESS", "results": [ { "code": "opINNER", "tr": { - "type": "INVOKE_HOST_FUNCTION", - "invokeHostFunctionResult": { - "code": "INVOKE_HOST_FUNCTION_TRAPPED" + "type": "RESTORE_FOOTPRINT", + "restoreFootprintResult": { + "code": "RESTORE_FOOTPRINT_SUCCESS" } } } @@ -1798,13 +1815,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 11, + "lastModifiedLedgerSeq": 8, "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", "balance": 400000000, - "seqNum": 47244640256, + "seqNum": 34359738368, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1828,9 +1845,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640256, + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "balance": 398999900, + "seqNum": 34359738368, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1862,9 +1879,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640256, + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "balance": 398999900, + "seqNum": 34359738368, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1888,9 +1905,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640257, + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "balance": 398999900, + "seqNum": 34359738369, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1932,7 +1949,44 @@ } } ], - "operations": [], + "operations": [ + { + "changes": [ + { + "type": "LEDGER_ENTRY_STATE", + "state": { + "lastModifiedLedgerSeq": 7, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "4791962cd1e2c7b8f8af3f96514f9777f0156a48261fb885a571a7f69b33a058", + "liveUntilLedgerSeq": 26 + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_UPDATED", + "updated": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "4791962cd1e2c7b8f8af3f96514f9777f0156a48261fb885a571a7f69b33a058", + "liveUntilLedgerSeq": 47 + } + }, + "ext": { + "v": 0 + } + } + } + ] + } + ], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -1941,9 +1995,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640257, + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "balance": 398999900, + "seqNum": 34359738369, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1991,9 +2045,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399938388, - "seqNum": 47244640257, + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "balance": 399948453, + "seqNum": 34359738369, "numSubEntries": 0, "inflationDest": null, "flags": 0, diff --git a/src/testdata/ledger-close-meta-v1-protocol-21.json b/src/testdata/ledger-close-meta-v1-protocol-21.json index 0f7de7eb79..1851a23f3e 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-21.json +++ b/src/testdata/ledger-close-meta-v1-protocol-21.json @@ -6,24 +6,24 @@ "v": 0 }, "ledgerHeader": { - "hash": "cf2b52270304cb86b2000cd1528f896d2275378976fe2cbc136da351c53b73ae", + "hash": "52f4e92f487154e485346c691585a082a9733ebab749c580734e9b13be42c963", "header": { "ledgerVersion": 21, - "previousLedgerHash": "98acdb62cdbd63ea8fabe7c255adcf3a12275fc8b1809e83acdcfce28686b3e8", + "previousLedgerHash": "4d6b671a994888a7276f1bd0ebf844b678284f483258f6e11378fafe7262ea6c", "scpValue": { - "txSetHash": "bd07f5ab8240ac3d89c8bdff438ac8dc517b59c04463bb42ee1fccd74e639c13", + "txSetHash": "ecd3150886583d2df7c8e2da0043cdb5cba4f8a9371283bec5f3856e019df40c", "closeTime": 0, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "4a71625ec2e4a6123dca54cb64aad965a566db35a63003e5463e4646c0c89205c1aed269cc14c41d66d8cff3848772f98a2ab889cd327a2b346eeaf44e7bfc0b" + "signature": "28f38eed1571b69f23307a87c67fdabf7e619bb0cef976bc460bb40aa68f1fa97db858aef8484c35837ce8794e2d2a492bff14ee4ca75b67d4f10646a04e000b" } } }, "txSetResultHash": "f66233c106977a4cc148e019411ff6ddfaf76c337d004ed9a304a70407b161d0", - "bucketListHash": "7ac058a4d395c68f9a26602186ce2cd99c992c0da55b630e1b36bb7dff8352d9", + "bucketListHash": "ade00de2089f5d22038df58ed0acab53cd53079fc0980d423b8edf61506c6481", "ledgerSeq": 7, "totalCoins": 1000000000000000000, "feePool": 800, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "98acdb62cdbd63ea8fabe7c255adcf3a12275fc8b1809e83acdcfce28686b3e8", + "previousLedgerHash": "4d6b671a994888a7276f1bd0ebf844b678284f483258f6e11378fafe7262ea6c", "phases": [ { "v": 0, diff --git a/src/testdata/ledger-close-meta-v1-protocol-22-soroban.json b/src/testdata/ledger-close-meta-v1-protocol-22-soroban.json index d46bba1e91..8385a5aac5 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-22-soroban.json +++ b/src/testdata/ledger-close-meta-v1-protocol-22-soroban.json @@ -6,24 +6,24 @@ "v": 0 }, "ledgerHeader": { - "hash": "731c4791022bd35ba864642a7a1366ef37a2b7cb39ac2b23c1f9d0a3b6c0157d", + "hash": "4826f5aad628c06b660c659f5f9ba5a509d6afe5c0f391e53033686ad6bb067b", "header": { "ledgerVersion": 22, - "previousLedgerHash": "7b4668bf68d1c677cfa80cfe3e3aac5def6035a6033897eb63107df8198128b7", + "previousLedgerHash": "482d6a36152b224efaad7795387c1cc402d2f600a2cd886c4fce713abb582bf0", "scpValue": { - "txSetHash": "8198019d94ed679aea6b1097ba9b9dee32002f9568b7a6b23e1cf2b14d83bd54", + "txSetHash": "709b85dde5b077ff46ee9de1c0e364dad5baccc0d5383f05f9122f704f96e82d", "closeTime": 1451692800, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "a8e0f4e2153e0f492d65d8b44c0f8911f7c7eeefdb6affd3626e2eaec7ae2cda3e38019912ef1602b9f7fc2c5325ed792a72eef1276f098e5680a7d9a9308a08" + "signature": "58d25aa9ac8d2183d64a1c326e595c840280a53506c05c536e9cd85422126b9c83aeab0cf67e72c8ea720303190448131fca1fac7ac356b80ee0be96992ad707" } } }, - "txSetResultHash": "c1f2e605905ad744b9dc6ac2cf506d00f08799f7a55f55e5bc0316ed1391773a", - "bucketListHash": "183ca6ee7121692a6e8acc672e8fcc66c4787c7353191fc3879bd7adbc1b3717", + "txSetResultHash": "665c93b57fa49e038bb55b65055f7e3e11474e925aa7a5ad22aa77d07151eace", + "bucketListHash": "c3156e662ded9f4850edeb3cb47305b814e17e248b38b961c9ddb83668e19ea4", "ledgerSeq": 28, "totalCoins": 1000000000000000000, "feePool": 804520, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "7b4668bf68d1c677cfa80cfe3e3aac5def6035a6033897eb63107df8198128b7", + "previousLedgerHash": "482d6a36152b224efaad7795387c1cc402d2f600a2cd886c4fce713abb582bf0", "phases": [ { "v": 0, @@ -503,19 +503,18 @@ "txProcessing": [ { "result": { - "transactionHash": "e310227a8c0d8d1f78632e65ebca281cd60d8619c9afc64491bcce98e7cd7ee3", + "transactionHash": "bb0a6b13caea6b015555dfd332aca1099e8654896bf7d1bcce8432e833a2572a", "result": { - "feeCharged": 106775, + "feeCharged": 61612, "result": { - "code": "txSUCCESS", + "code": "txFAILED", "results": [ { "code": "opINNER", "tr": { "type": "INVOKE_HOST_FUNCTION", "invokeHostFunctionResult": { - "code": "INVOKE_HOST_FUNCTION_SUCCESS", - "success": "cbbc48750debb8535093b3deaf88ac7f4cff87425576a58de2bac754acdb4616" + "code": "INVOKE_HOST_FUNCTION_TRAPPED" } } } @@ -530,13 +529,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 10, + "lastModifiedLedgerSeq": 11, "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", "balance": 400000000, - "seqNum": 42949672960, + "seqNum": 47244640256, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -560,9 +559,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672960, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640256, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -594,9 +593,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672960, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640256, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -620,9 +619,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672961, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640257, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -664,55 +663,7 @@ } } ], - "operations": [ - { - "changes": [ - { - "type": "LEDGER_ENTRY_CREATED", - "created": { - "lastModifiedLedgerSeq": 28, - "data": { - "type": "CONTRACT_DATA", - "contractData": { - "ext": { - "v": 0 - }, - "contract": "CAA3QKIP2SNVXUJTB4HKOGF55JTSSMQGED3FZYNHMNSXYV3DRRMAWA3Y", - "key": { - "type": "SCV_SYMBOL", - "sym": "key" - }, - "durability": "PERSISTENT", - "val": { - "type": "SCV_U64", - "u64": 42 - } - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_CREATED", - "created": { - "lastModifiedLedgerSeq": 28, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "764f4e59e20ac1a357f9f26ab0eaf46d196ab74822db44f039353a6f114864aa", - "liveUntilLedgerSeq": 47 - } - }, - "ext": { - "v": 0 - } - } - } - ] - } - ], + "operations": [], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -721,9 +672,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399873274, - "seqNum": 42949672961, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399898388, + "seqNum": 47244640257, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -771,9 +722,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", - "balance": 399893225, - "seqNum": 42949672961, + "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "balance": 399938388, + "seqNum": 47244640257, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -821,7 +772,8 @@ }, "events": [], "returnValue": { - "type": "SCV_VOID" + "type": "SCV_BOOL", + "b": "FALSE" }, "diagnosticEvents": [] } @@ -830,18 +782,18 @@ }, { "result": { - "transactionHash": "364ec41dce0a678476ea3ebfc5caa28165ef3bf0976071d858b1c4044f187d25", + "transactionHash": "62d28c373389d447341e9d75bc84e2c91437169a2a70d3606c8b3aa7d198ef5c", "result": { - "feeCharged": 60559, + "feeCharged": 42954, "result": { - "code": "txSUCCESS", + "code": "txFAILED", "results": [ { "code": "opINNER", "tr": { - "type": "EXTEND_FOOTPRINT_TTL", - "extendFootprintTTLResult": { - "code": "EXTEND_FOOTPRINT_TTL_SUCCESS" + "type": "INVOKE_HOST_FUNCTION", + "invokeHostFunctionResult": { + "code": "INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED" } } } @@ -856,13 +808,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 9, + "lastModifiedLedgerSeq": 12, "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", "balance": 400000000, - "seqNum": 38654705664, + "seqNum": 51539607552, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -886,9 +838,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705664, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607552, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -920,9 +872,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705664, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607552, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -946,9 +898,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705665, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607553, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -990,76 +942,7 @@ } } ], - "operations": [ - { - "changes": [ - { - "type": "LEDGER_ENTRY_STATE", - "state": { - "lastModifiedLedgerSeq": 6, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", - "liveUntilLedgerSeq": 10006 - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_UPDATED", - "updated": { - "lastModifiedLedgerSeq": 28, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", - "liveUntilLedgerSeq": 10028 - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_STATE", - "state": { - "lastModifiedLedgerSeq": 6, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", - "liveUntilLedgerSeq": 10006 - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_UPDATED", - "updated": { - "lastModifiedLedgerSeq": 28, - "data": { - "type": "TTL", - "ttl": { - "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", - "liveUntilLedgerSeq": 10028 - } - }, - "ext": { - "v": 0 - } - } - } - ] - } - ], + "operations": [], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -1068,9 +951,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 398999900, - "seqNum": 38654705665, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 398956045, + "seqNum": 51539607553, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1118,9 +1001,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 399939441, - "seqNum": 38654705665, + "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "balance": 399957046, + "seqNum": 51539607553, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1494,18 +1377,19 @@ }, { "result": { - "transactionHash": "62d28c373389d447341e9d75bc84e2c91437169a2a70d3606c8b3aa7d198ef5c", + "transactionHash": "e310227a8c0d8d1f78632e65ebca281cd60d8619c9afc64491bcce98e7cd7ee3", "result": { - "feeCharged": 42954, + "feeCharged": 106775, "result": { - "code": "txFAILED", + "code": "txSUCCESS", "results": [ { "code": "opINNER", "tr": { "type": "INVOKE_HOST_FUNCTION", "invokeHostFunctionResult": { - "code": "INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED" + "code": "INVOKE_HOST_FUNCTION_SUCCESS", + "success": "cbbc48750debb8535093b3deaf88ac7f4cff87425576a58de2bac754acdb4616" } } } @@ -1520,13 +1404,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 12, + "lastModifiedLedgerSeq": 10, "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", "balance": 400000000, - "seqNum": 51539607552, + "seqNum": 42949672960, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1550,9 +1434,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607552, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672960, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1584,9 +1468,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607552, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672960, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1610,9 +1494,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607553, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672961, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1654,7 +1538,55 @@ } } ], - "operations": [], + "operations": [ + { + "changes": [ + { + "type": "LEDGER_ENTRY_CREATED", + "created": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "CONTRACT_DATA", + "contractData": { + "ext": { + "v": 0 + }, + "contract": "CAA3QKIP2SNVXUJTB4HKOGF55JTSSMQGED3FZYNHMNSXYV3DRRMAWA3Y", + "key": { + "type": "SCV_SYMBOL", + "sym": "key" + }, + "durability": "PERSISTENT", + "val": { + "type": "SCV_U64", + "u64": 42 + } + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_CREATED", + "created": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "764f4e59e20ac1a357f9f26ab0eaf46d196ab74822db44f039353a6f114864aa", + "liveUntilLedgerSeq": 47 + } + }, + "ext": { + "v": 0 + } + } + } + ] + } + ], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -1663,9 +1595,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 398956045, - "seqNum": 51539607553, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399873274, + "seqNum": 42949672961, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1713,9 +1645,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GA2NXNEE2MHWGQP5XXACPYG2BDZFPKGYPFNST5V3ZZN75NSLQAEXX7CU", - "balance": 399957046, - "seqNum": 51539607553, + "accountID": "GDWWCIR2FIWTY2D3CEDXZYRTRNTFZCC5PBCGC6XPMKCLUV7BRG2AT3RD", + "balance": 399893225, + "seqNum": 42949672961, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1763,8 +1695,7 @@ }, "events": [], "returnValue": { - "type": "SCV_BOOL", - "b": "FALSE" + "type": "SCV_VOID" }, "diagnosticEvents": [] } @@ -1773,18 +1704,18 @@ }, { "result": { - "transactionHash": "bb0a6b13caea6b015555dfd332aca1099e8654896bf7d1bcce8432e833a2572a", + "transactionHash": "364ec41dce0a678476ea3ebfc5caa28165ef3bf0976071d858b1c4044f187d25", "result": { - "feeCharged": 61612, + "feeCharged": 60559, "result": { - "code": "txFAILED", + "code": "txSUCCESS", "results": [ { "code": "opINNER", "tr": { - "type": "INVOKE_HOST_FUNCTION", - "invokeHostFunctionResult": { - "code": "INVOKE_HOST_FUNCTION_TRAPPED" + "type": "EXTEND_FOOTPRINT_TTL", + "extendFootprintTTLResult": { + "code": "EXTEND_FOOTPRINT_TTL_SUCCESS" } } } @@ -1799,13 +1730,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 11, + "lastModifiedLedgerSeq": 9, "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", "balance": 400000000, - "seqNum": 47244640256, + "seqNum": 38654705664, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1829,9 +1760,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640256, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 398999900, + "seqNum": 38654705664, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1863,9 +1794,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640256, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 398999900, + "seqNum": 38654705664, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1889,9 +1820,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640257, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 398999900, + "seqNum": 38654705665, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1933,7 +1864,76 @@ } } ], - "operations": [], + "operations": [ + { + "changes": [ + { + "type": "LEDGER_ENTRY_STATE", + "state": { + "lastModifiedLedgerSeq": 6, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", + "liveUntilLedgerSeq": 10006 + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_UPDATED", + "updated": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "091ddece931776a53f93869b82c24e132cc12d00d961fac09bc3b9cb9021c62d", + "liveUntilLedgerSeq": 10028 + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_STATE", + "state": { + "lastModifiedLedgerSeq": 6, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", + "liveUntilLedgerSeq": 10006 + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_UPDATED", + "updated": { + "lastModifiedLedgerSeq": 28, + "data": { + "type": "TTL", + "ttl": { + "keyHash": "60313f9b273db0b14c3e503cf6cc152dd14a0c57e5e81a23e86b4e27a23a2c06", + "liveUntilLedgerSeq": 10028 + } + }, + "ext": { + "v": 0 + } + } + } + ] + } + ], "txChangesAfter": [ { "type": "LEDGER_ENTRY_STATE", @@ -1942,9 +1942,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399898388, - "seqNum": 47244640257, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 398999900, + "seqNum": 38654705665, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -1992,9 +1992,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GAM4XNEHJUHN7VE3ZWJI23R2WS3SJS2BTUHZAC6XICXLXO2HPX4QI2IR", - "balance": 399938388, - "seqNum": 47244640257, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 399939441, + "seqNum": 38654705665, "numSubEntries": 0, "inflationDest": null, "flags": 0, diff --git a/src/testdata/ledger-close-meta-v1-protocol-22.json b/src/testdata/ledger-close-meta-v1-protocol-22.json index 4e4c97350c..f9e1ff43fe 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-22.json +++ b/src/testdata/ledger-close-meta-v1-protocol-22.json @@ -6,24 +6,24 @@ "v": 0 }, "ledgerHeader": { - "hash": "2341d7975a9e6b34b3a0747ad6ae6638e0c516f7d717a0ecccab162ed3b67bdb", + "hash": "bb89aefaf31b3f03f6f7623c75dd055f4e58773b557eda1118b5a9d2b80b33b9", "header": { "ledgerVersion": 22, - "previousLedgerHash": "977a66c415a346e2f37169166515cd659ce92c667278e87f62e64cfb2fc801cf", + "previousLedgerHash": "7571e5186d594475cfb7107be2ac14b4aa70e6ccf31810dd961eb91168443ac3", "scpValue": { - "txSetHash": "ca0e9eb8e933aff12be1bb47059f6a8365f1693674e87e22b799ccb15a592aed", + "txSetHash": "833ee1e2b95263731bc434c06c0878aa93b2466b3ec05cbda1c4c60881249301", "closeTime": 0, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "82f10c76b00ffd3737314bdcf34eab825506bc82ac40bca3a0c85b51254ea8b76bb87bf380f2994089e5b25f01d60e09081147b47517c17cafd4d7396ada7909" + "signature": "6d0af8ae88d6cf05d4ef0fbd85e3e0676fc9f5334e8630cced3ca1f9521c34e6f6ae7c4a7ad296a1a1a092bbe9b40802462511ec99e389b7d953ba7695339802" } } }, "txSetResultHash": "f66233c106977a4cc148e019411ff6ddfaf76c337d004ed9a304a70407b161d0", - "bucketListHash": "be7c8d76cf6274260482c57a581f5b0c1dfb2a318665641393697a296bba994f", + "bucketListHash": "bfe580088e8d44d0f6be8f0dd5d55ffdd22931b66a80c88407b169eeca70aa5c", "ledgerSeq": 7, "totalCoins": 1000000000000000000, "feePool": 800, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "977a66c415a346e2f37169166515cd659ce92c667278e87f62e64cfb2fc801cf", + "previousLedgerHash": "7571e5186d594475cfb7107be2ac14b4aa70e6ccf31810dd961eb91168443ac3", "phases": [ { "v": 0, diff --git a/src/testdata/ledger-close-meta-v1-protocol-23-soroban.json b/src/testdata/ledger-close-meta-v1-protocol-23-soroban.json index c7cbfc9ada..c3893b7f4d 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-23-soroban.json +++ b/src/testdata/ledger-close-meta-v1-protocol-23-soroban.json @@ -6,24 +6,24 @@ "v": 0 }, "ledgerHeader": { - "hash": "85a08b356fe8dd72e5ff999b7187f411103df3617c2b7085dbbca99587f9651a", + "hash": "6ee5024b08095c9d7e2df55efca112c670a09c433bb21614c360d6be556ae57f", "header": { "ledgerVersion": 23, - "previousLedgerHash": "2b4f5fcff7bd087d4b6e7c6ded785c5ff466b3e0d6f304da8295c9a37197ed96", + "previousLedgerHash": "40667fafcadeb2372487f935ce89bfc018f9e60e68bbe01e6de6ad4e607c9645", "scpValue": { - "txSetHash": "24740b1ffa1584a68e5bed13068340cc8999577c9ab2eea2173c470d4a8a72d1", + "txSetHash": "22533247312c90534ebcd9691c93d9e61dc443dd15c522cc913d1d939af90fd1", "closeTime": 1451692800, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "497d04432640e9de6ce91feb3723ea87d20a2c34ad9d6c1fe142e6a30e415213cde0ca12a4c514c4660f38a5c9b7151da5562da4c563bca8e7e0abbf39a31909" + "signature": "c9437f7d1bb05bd94f8fa3fc5b1d1d7f6cd59a36bbc26b315fda47b87d62fc37464053aac9ed547dd834c3b4f1707bdfe000c932ae151118e7a1fc1dfe839b0e" } } }, "txSetResultHash": "65b6fe91abfe43ed98fa2163f08fdf3f2f3231101bba05102521186c25a1cc4b", - "bucketListHash": "8c1bdb45de59b67cfa87badc1b522439bea0cda2e6d453eb67212247ad441fd1", + "bucketListHash": "42be10fa8d2ad869f309db62c432d94231a89533f7671be4b759f24aa0ee2234", "ledgerSeq": 28, "totalCoins": 1000000000000000000, "feePool": 804520, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "2b4f5fcff7bd087d4b6e7c6ded785c5ff466b3e0d6f304da8295c9a37197ed96", + "previousLedgerHash": "40667fafcadeb2372487f935ce89bfc018f9e60e68bbe01e6de6ad4e607c9645", "phases": [ { "v": 0, diff --git a/src/testdata/ledger-close-meta-v1-protocol-23.json b/src/testdata/ledger-close-meta-v1-protocol-23.json index 182097130e..8ff9a283c1 100644 --- a/src/testdata/ledger-close-meta-v1-protocol-23.json +++ b/src/testdata/ledger-close-meta-v1-protocol-23.json @@ -6,24 +6,24 @@ "v": 0 }, "ledgerHeader": { - "hash": "544367e4a7271f352eb91566e9e748ed03246b8a445bda3c70b1e93e3d751f7b", + "hash": "955521810ce73e205a011f6f7313ff47da2d9ff3779ade702ded8654d6382211", "header": { "ledgerVersion": 23, - "previousLedgerHash": "a8fa722c806905e1bf3b3cb7750db78031ad228c2812d2a3479b06db95b0bd43", + "previousLedgerHash": "7a215a87c49cfb4d83abd92241b2059cb2270f2e7d93bd672fa28f700ef7dc20", "scpValue": { - "txSetHash": "969ab56f99763716d1fc4480bfe27bb5dfaaf1666dd44cdcd6c51d8fc9074d2c", + "txSetHash": "6319480f16c93c4a9b31b0b4dc3646275418630d507a6ec6a2a0b2527a0c88ba", "closeTime": 0, "upgrades": [], "ext": { "v": "STELLAR_VALUE_SIGNED", "lcValueSignature": { "nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O", - "signature": "f6f4db8cc07c1d2f07f95b0b221a8ce55ae214dc51d82a71432352e6b3a4583b5930f643110a18bec0684d884d68d066ef3d0a051019f74648f9ef38d17c5707" + "signature": "0372a515f08fb718defc47f5bfb1236dc4cbff9bccdab5514ef71b3bbbe51c49c1bf47abfc166c5782bd42ea20b01dc2614fde91b8fb887b5d4fc43e1dd8c408" } } }, - "txSetResultHash": "f66233c106977a4cc148e019411ff6ddfaf76c337d004ed9a304a70407b161d0", - "bucketListHash": "e9db6e23db1e6a733b8d285e5ca8eab8c3b6b7d8d1bace90afe02df7ce0dbecb", + "txSetResultHash": "249b974bacf8b5c4a8f0b5598194c1b9eca64af0b5c1506daa871c1533b6baac", + "bucketListHash": "486d15e891ed49429510506d016999b3a8b74349c3104000bc0a102e7d34ed81", "ledgerSeq": 7, "totalCoins": 1000000000000000000, "feePool": 800, @@ -49,7 +49,7 @@ "txSet": { "v": 1, "v1TxSet": { - "previousLedgerHash": "a8fa722c806905e1bf3b3cb7750db78031ad228c2812d2a3479b06db95b0bd43", + "previousLedgerHash": "7a215a87c49cfb4d83abd92241b2059cb2270f2e7d93bd672fa28f700ef7dc20", "phases": [ { "v": 0, @@ -185,43 +185,22 @@ "txProcessing": [ { "result": { - "transactionHash": "324d0628e2a215d367f181f0e3aacbaa26fa638e676e73fb9ad26a360314a7b7", + "transactionHash": "0db2322d85e9d8ea2421559922bb6107429650ebdad304c907480853d465c10d", "result": { - "feeCharged": 300, + "feeCharged": 100, "result": { - "code": "txFEE_BUMP_INNER_SUCCESS", - "innerResultPair": { - "transactionHash": "b28c171f9658320b5ce8d50e4e1a36b74afbb2a92eec7df92a8981067131b025", - "result": { - "feeCharged": 200, - "result": { - "code": "txSUCCESS", - "results": [ - { - "code": "opINNER", - "tr": { - "type": "PAYMENT", - "paymentResult": { - "code": "PAYMENT_SUCCESS" - } - } - }, - { - "code": "opINNER", - "tr": { - "type": "PAYMENT", - "paymentResult": { - "code": "PAYMENT_SUCCESS" - } - } - } - ] - }, - "ext": { - "v": 0 + "code": "txSUCCESS", + "results": [ + { + "code": "opINNER", + "tr": { + "type": "PAYMENT", + "paymentResult": { + "code": "PAYMENT_SUCCESS" + } } } - } + ] }, "ext": { "v": 0 @@ -232,13 +211,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 4, + "lastModifiedLedgerSeq": 5, "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 400000000, - "seqNum": 17179869184, + "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", + "balance": 999999998999989700, + "seqNum": 3, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -246,7 +225,31 @@ "thresholds": "01000000", "signers": [], "ext": { - "v": 0 + "v": 1, + "v1": { + "liabilities": { + "buying": 0, + "selling": 0 + }, + "ext": { + "v": 2, + "v2": { + "numSponsored": 0, + "numSponsoring": 0, + "signerSponsoringIDs": [], + "ext": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "seqLedger": 5, + "seqTime": 0 + } + } + } + } + } } } }, @@ -262,9 +265,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 399999700, - "seqNum": 17179869184, + "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", + "balance": 999999998999989600, + "seqNum": 3, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -272,7 +275,31 @@ "thresholds": "01000000", "signers": [], "ext": { - "v": 0 + "v": 1, + "v1": { + "liabilities": { + "buying": 0, + "selling": 0 + }, + "ext": { + "v": 2, + "v2": { + "numSponsored": 0, + "numSponsoring": 0, + "signerSponsoringIDs": [], + "ext": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "seqLedger": 5, + "seqTime": 0 + } + } + } + } + } } } }, @@ -296,61 +323,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 399999700, - "seqNum": 17179869184, - "numSubEntries": 0, - "inflationDest": null, - "flags": 0, - "homeDomain": "", - "thresholds": "01000000", - "signers": [], - "ext": { - "v": 0 - } - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_UPDATED", - "updated": { - "lastModifiedLedgerSeq": 7, - "data": { - "type": "ACCOUNT", - "account": { - "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", - "balance": 399999700, - "seqNum": 17179869184, - "numSubEntries": 0, - "inflationDest": null, - "flags": 0, - "homeDomain": "", - "thresholds": "01000000", - "signers": [], - "ext": { - "v": 0 - } - } - }, - "ext": { - "v": 0 - } - } - }, - { - "type": "LEDGER_ENTRY_STATE", - "state": { - "lastModifiedLedgerSeq": 5, - "data": { - "type": "ACCOUNT", - "account": { - "accountID": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q", - "balance": 200010000, - "seqNum": 21474836480, + "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", + "balance": 999999998999989600, + "seqNum": 3, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -358,7 +333,31 @@ "thresholds": "01000000", "signers": [], "ext": { - "v": 0 + "v": 1, + "v1": { + "liabilities": { + "buying": 0, + "selling": 0 + }, + "ext": { + "v": 2, + "v2": { + "numSponsored": 0, + "numSponsoring": 0, + "signerSponsoringIDs": [], + "ext": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "seqLedger": 5, + "seqTime": 0 + } + } + } + } + } } } }, @@ -374,9 +373,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q", - "balance": 200010000, - "seqNum": 21474836481, + "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", + "balance": 999999998999989600, + "seqNum": 4, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -426,18 +425,43 @@ "state": { "lastModifiedLedgerSeq": 6, "data": { - "type": "TRUSTLINE", - "trustLine": { + "type": "ACCOUNT", + "account": { "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", - "asset": { - "assetCode": "CUR1", - "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" - }, - "balance": 0, - "limit": 100, - "flags": 1, + "balance": 399999900, + "seqNum": 12884901889, + "numSubEntries": 1, + "inflationDest": null, + "flags": 0, + "homeDomain": "", + "thresholds": "01000000", + "signers": [], "ext": { - "v": 0 + "v": 1, + "v1": { + "liabilities": { + "buying": 0, + "selling": 0 + }, + "ext": { + "v": 2, + "v2": { + "numSponsored": 0, + "numSponsoring": 0, + "signerSponsoringIDs": [], + "ext": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "seqLedger": 6, + "seqTime": 0 + } + } + } + } + } } } }, @@ -451,18 +475,43 @@ "updated": { "lastModifiedLedgerSeq": 7, "data": { - "type": "TRUSTLINE", - "trustLine": { + "type": "ACCOUNT", + "account": { "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", - "asset": { - "assetCode": "CUR1", - "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" - }, - "balance": 50, - "limit": 100, - "flags": 1, + "balance": 400000900, + "seqNum": 12884901889, + "numSubEntries": 1, + "inflationDest": null, + "flags": 0, + "homeDomain": "", + "thresholds": "01000000", + "signers": [], "ext": { - "v": 0 + "v": 1, + "v1": { + "liabilities": { + "buying": 0, + "selling": 0 + }, + "ext": { + "v": 2, + "v2": { + "numSponsored": 0, + "numSponsoring": 0, + "signerSponsoringIDs": [], + "ext": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "seqLedger": 6, + "seqTime": 0 + } + } + } + } + } } } }, @@ -470,28 +519,49 @@ "v": 0 } } - } - ] - }, - { - "changes": [ + }, { "type": "LEDGER_ENTRY_STATE", "state": { "lastModifiedLedgerSeq": 7, "data": { - "type": "TRUSTLINE", - "trustLine": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", - "asset": { - "assetCode": "CUR1", - "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" - }, - "balance": 50, - "limit": 100, - "flags": 1, + "type": "ACCOUNT", + "account": { + "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", + "balance": 999999998999989600, + "seqNum": 4, + "numSubEntries": 0, + "inflationDest": null, + "flags": 0, + "homeDomain": "", + "thresholds": "01000000", + "signers": [], "ext": { - "v": 0 + "v": 1, + "v1": { + "liabilities": { + "buying": 0, + "selling": 0 + }, + "ext": { + "v": 2, + "v2": { + "numSponsored": 0, + "numSponsoring": 0, + "signerSponsoringIDs": [], + "ext": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "seqLedger": 7, + "seqTime": 0 + } + } + } + } + } } } }, @@ -505,18 +575,43 @@ "updated": { "lastModifiedLedgerSeq": 7, "data": { - "type": "TRUSTLINE", - "trustLine": { - "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", - "asset": { - "assetCode": "CUR1", - "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" - }, - "balance": 100, - "limit": 100, - "flags": 1, + "type": "ACCOUNT", + "account": { + "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", + "balance": 999999998999988600, + "seqNum": 4, + "numSubEntries": 0, + "inflationDest": null, + "flags": 0, + "homeDomain": "", + "thresholds": "01000000", + "signers": [], "ext": { - "v": 0 + "v": 1, + "v1": { + "liabilities": { + "buying": 0, + "selling": 0 + }, + "ext": { + "v": 2, + "v2": { + "numSponsored": 0, + "numSponsoring": 0, + "signerSponsoringIDs": [], + "ext": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "seqLedger": 7, + "seqTime": 0 + } + } + } + } + } } } }, @@ -535,22 +630,43 @@ }, { "result": { - "transactionHash": "0db2322d85e9d8ea2421559922bb6107429650ebdad304c907480853d465c10d", + "transactionHash": "324d0628e2a215d367f181f0e3aacbaa26fa638e676e73fb9ad26a360314a7b7", "result": { - "feeCharged": 100, + "feeCharged": 300, "result": { - "code": "txSUCCESS", - "results": [ - { - "code": "opINNER", - "tr": { - "type": "PAYMENT", - "paymentResult": { - "code": "PAYMENT_SUCCESS" - } + "code": "txFEE_BUMP_INNER_SUCCESS", + "innerResultPair": { + "transactionHash": "b28c171f9658320b5ce8d50e4e1a36b74afbb2a92eec7df92a8981067131b025", + "result": { + "feeCharged": 200, + "result": { + "code": "txSUCCESS", + "results": [ + { + "code": "opINNER", + "tr": { + "type": "PAYMENT", + "paymentResult": { + "code": "PAYMENT_SUCCESS" + } + } + }, + { + "code": "opINNER", + "tr": { + "type": "PAYMENT", + "paymentResult": { + "code": "PAYMENT_SUCCESS" + } + } + } + ] + }, + "ext": { + "v": 0 } } - ] + } }, "ext": { "v": 0 @@ -561,13 +677,13 @@ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 5, + "lastModifiedLedgerSeq": 4, "data": { "type": "ACCOUNT", "account": { - "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", - "balance": 999999998999989700, - "seqNum": 3, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 400000000, + "seqNum": 17179869184, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -575,31 +691,7 @@ "thresholds": "01000000", "signers": [], "ext": { - "v": 1, - "v1": { - "liabilities": { - "buying": 0, - "selling": 0 - }, - "ext": { - "v": 2, - "v2": { - "numSponsored": 0, - "numSponsoring": 0, - "signerSponsoringIDs": [], - "ext": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "seqLedger": 5, - "seqTime": 0 - } - } - } - } - } + "v": 0 } } }, @@ -615,9 +707,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", - "balance": 999999998999989600, - "seqNum": 3, + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 399999700, + "seqNum": 17179869184, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -625,57 +717,85 @@ "thresholds": "01000000", "signers": [], "ext": { - "v": 1, - "v1": { - "liabilities": { - "buying": 0, - "selling": 0 - }, + "v": 0 + } + } + }, + "ext": { + "v": 0 + } + } + } + ], + "txApplyProcessing": { + "v": 3, + "v3": { + "ext": { + "v": 0 + }, + "txChangesBefore": [ + { + "type": "LEDGER_ENTRY_STATE", + "state": { + "lastModifiedLedgerSeq": 7, + "data": { + "type": "ACCOUNT", + "account": { + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 399999700, + "seqNum": 17179869184, + "numSubEntries": 0, + "inflationDest": null, + "flags": 0, + "homeDomain": "", + "thresholds": "01000000", + "signers": [], "ext": { - "v": 2, - "v2": { - "numSponsored": 0, - "numSponsoring": 0, - "signerSponsoringIDs": [], - "ext": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "seqLedger": 5, - "seqTime": 0 - } - } - } + "v": 0 + } + } + }, + "ext": { + "v": 0 + } + } + }, + { + "type": "LEDGER_ENTRY_UPDATED", + "updated": { + "lastModifiedLedgerSeq": 7, + "data": { + "type": "ACCOUNT", + "account": { + "accountID": "GCAEBM3GKNR6SV6N73FSGBXU6NSMZ2URQVMJQHXFQFY2PJPX6YBCSAKZ", + "balance": 399999700, + "seqNum": 17179869184, + "numSubEntries": 0, + "inflationDest": null, + "flags": 0, + "homeDomain": "", + "thresholds": "01000000", + "signers": [], + "ext": { + "v": 0 } } + }, + "ext": { + "v": 0 } } }, - "ext": { - "v": 0 - } - } - } - ], - "txApplyProcessing": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "txChangesBefore": [ { "type": "LEDGER_ENTRY_STATE", "state": { - "lastModifiedLedgerSeq": 7, + "lastModifiedLedgerSeq": 5, "data": { "type": "ACCOUNT", "account": { - "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", - "balance": 999999998999989600, - "seqNum": 3, + "accountID": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q", + "balance": 200010000, + "seqNum": 21474836480, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -683,31 +803,7 @@ "thresholds": "01000000", "signers": [], "ext": { - "v": 1, - "v1": { - "liabilities": { - "buying": 0, - "selling": 0 - }, - "ext": { - "v": 2, - "v2": { - "numSponsored": 0, - "numSponsoring": 0, - "signerSponsoringIDs": [], - "ext": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "seqLedger": 5, - "seqTime": 0 - } - } - } - } - } + "v": 0 } } }, @@ -723,9 +819,9 @@ "data": { "type": "ACCOUNT", "account": { - "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", - "balance": 999999998999989600, - "seqNum": 4, + "accountID": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q", + "balance": 200010000, + "seqNum": 21474836481, "numSubEntries": 0, "inflationDest": null, "flags": 0, @@ -775,43 +871,18 @@ "state": { "lastModifiedLedgerSeq": 6, "data": { - "type": "ACCOUNT", - "account": { + "type": "TRUSTLINE", + "trustLine": { "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", - "balance": 399999900, - "seqNum": 12884901889, - "numSubEntries": 1, - "inflationDest": null, - "flags": 0, - "homeDomain": "", - "thresholds": "01000000", - "signers": [], + "asset": { + "assetCode": "CUR1", + "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" + }, + "balance": 0, + "limit": 100, + "flags": 1, "ext": { - "v": 1, - "v1": { - "liabilities": { - "buying": 0, - "selling": 0 - }, - "ext": { - "v": 2, - "v2": { - "numSponsored": 0, - "numSponsoring": 0, - "signerSponsoringIDs": [], - "ext": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "seqLedger": 6, - "seqTime": 0 - } - } - } - } - } + "v": 0 } } }, @@ -825,43 +896,18 @@ "updated": { "lastModifiedLedgerSeq": 7, "data": { - "type": "ACCOUNT", - "account": { + "type": "TRUSTLINE", + "trustLine": { "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", - "balance": 400000900, - "seqNum": 12884901889, - "numSubEntries": 1, - "inflationDest": null, - "flags": 0, - "homeDomain": "", - "thresholds": "01000000", - "signers": [], + "asset": { + "assetCode": "CUR1", + "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" + }, + "balance": 50, + "limit": 100, + "flags": 1, "ext": { - "v": 1, - "v1": { - "liabilities": { - "buying": 0, - "selling": 0 - }, - "ext": { - "v": 2, - "v2": { - "numSponsored": 0, - "numSponsoring": 0, - "signerSponsoringIDs": [], - "ext": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "seqLedger": 6, - "seqTime": 0 - } - } - } - } - } + "v": 0 } } }, @@ -869,49 +915,28 @@ "v": 0 } } - }, + } + ] + }, + { + "changes": [ { "type": "LEDGER_ENTRY_STATE", "state": { "lastModifiedLedgerSeq": 7, "data": { - "type": "ACCOUNT", - "account": { - "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", - "balance": 999999998999989600, - "seqNum": 4, - "numSubEntries": 0, - "inflationDest": null, - "flags": 0, - "homeDomain": "", - "thresholds": "01000000", - "signers": [], + "type": "TRUSTLINE", + "trustLine": { + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "asset": { + "assetCode": "CUR1", + "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" + }, + "balance": 50, + "limit": 100, + "flags": 1, "ext": { - "v": 1, - "v1": { - "liabilities": { - "buying": 0, - "selling": 0 - }, - "ext": { - "v": 2, - "v2": { - "numSponsored": 0, - "numSponsoring": 0, - "signerSponsoringIDs": [], - "ext": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "seqLedger": 7, - "seqTime": 0 - } - } - } - } - } + "v": 0 } } }, @@ -925,43 +950,18 @@ "updated": { "lastModifiedLedgerSeq": 7, "data": { - "type": "ACCOUNT", - "account": { - "accountID": "GC4EFXBN6BEENDAX7PBW5PGIIIVH3INMD3OEPQASXOLGOHVVP7ZEMG7X", - "balance": 999999998999988600, - "seqNum": 4, - "numSubEntries": 0, - "inflationDest": null, - "flags": 0, - "homeDomain": "", - "thresholds": "01000000", - "signers": [], + "type": "TRUSTLINE", + "trustLine": { + "accountID": "GB6MXQ5262ZJGDQNA6BL4TWE5SADVZXIKLPELFXKUE27X4SQTGQS44ZB", + "asset": { + "assetCode": "CUR1", + "issuer": "GCGE27HU2VYQANKL2VZWLCAOJYMEFST5DXPBWQ7BRRPOHUPK626DNG4Q" + }, + "balance": 100, + "limit": 100, + "flags": 1, "ext": { - "v": 1, - "v1": { - "liabilities": { - "buying": 0, - "selling": 0 - }, - "ext": { - "v": 2, - "v2": { - "numSponsored": 0, - "numSponsoring": 0, - "signerSponsoringIDs": [], - "ext": { - "v": 3, - "v3": { - "ext": { - "v": 0 - }, - "seqLedger": 7, - "seqTime": 0 - } - } - } - } - } + "v": 0 } } }, From dc19ff2369ae9c538e1dccfd4d9c5b6478cf6edd Mon Sep 17 00:00:00 2001 From: Dmytro Kozhevin Date: Mon, 4 Nov 2024 18:54:43 -0500 Subject: [PATCH 4/4] Add documentation for `updateRecalibratedCostTypesForV20` --- src/ledger/NetworkConfig.cpp | 3 +++ src/ledger/NetworkConfig.h | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ledger/NetworkConfig.cpp b/src/ledger/NetworkConfig.cpp index a842be46ea..334d53204b 100644 --- a/src/ledger/NetworkConfig.cpp +++ b/src/ledger/NetworkConfig.cpp @@ -1156,6 +1156,9 @@ SorobanNetworkConfig::initializeGenesisLedgerForTesting( ltx.loadHeader().current().ledgerVersion = static_cast(SOROBAN_PROTOCOL_VERSION); SorobanNetworkConfig::createLedgerEntriesForV20(ltx, app); + // Protocol 20 released with somewhat incorrect costs and has been + // re-calibrated short after the release. We catch up here to the more + // correct costs that exist on the network. updateRecalibratedCostTypesForV20(ltx); ltx.loadHeader().current().ledgerVersion = genesisLedgerProtocol; } diff --git a/src/ledger/NetworkConfig.h b/src/ledger/NetworkConfig.h index c3d36e04e9..7e4098dccf 100644 --- a/src/ledger/NetworkConfig.h +++ b/src/ledger/NetworkConfig.h @@ -335,7 +335,14 @@ class SorobanNetworkConfig #ifdef BUILD_TESTS StateArchivalSettings& stateArchivalSettings(); EvictionIterator& evictionIterator(); - + // Update the protocol 20 cost types to match the real network + // configuration. + // Protocol 20 cost types were imprecise and were re-calibrated shortly + // after the release. This should be called when initializing the test with + // protocol 20+. + // Future recalibrations should be accounted for in a similar way in order + // to have more accurage modelled CPU and memory costs in tests and + // especially the benchmarks. static void updateRecalibratedCostTypesForV20(AbstractLedgerTxn& ltx); #endif bool operator==(SorobanNetworkConfig const& other) const;