stellar / stellar-core

Reference implementation for the peer-to-peer agent that manages the Stellar network.
https://www.stellar.org
Other
3.12k stars 968 forks source link

Use root account in loadgen #4445

Open ThomasBrady opened 1 month ago

ThomasBrady commented 1 month ago

Currently, LoadGenerator operations require an initial account creation step and the GeneratedLoadConfig for the operations require specification of offsets to utilize the created accounts as source accounts. When LoadGenerator is start-ed, the mRoot account is initialized. Currently, the root account is only used to create other accounts. We should make it possible to utilize the mRoot account for loadgen operations. This would simplify loadgen usage by removing the extra account creation step and prevent footguns associated with specifying the correct offset in subsequent operations. In certain scenarios, this granular control is necessary, but for some operations, such as executing soroban network upgrades with loadgen, the exact account being used is irrelevant.

MonsieurNicolas commented 1 month ago

we need multiple accounts because of the way transaction queues work, so I am not sure which part of loadgen would get simplified?

ThomasBrady commented 1 month ago

we need multiple accounts because of the way transaction queues work,

Ah, I see. TransactionQueue::mAccountStates has a map from AccountID to AccountState, which only contains at most one transaction (std::optional<TimestampedTx> mTransaction;), meaning its not possible to have two transactions with the same source account in the transaction queue at one time?

so I am not sure which part of loadgen would get simplified?

I agree for most load gen operations we will want simultaneous transaction processing (and therefore need source accounts for each transaction), but if we want to have a linear sequence of transactions processed then we can re-use the same account, and the account could be the root account. For example, this issue was motivated by needing to create accounts in order to do soroban network upgrades with loadgen. That being said, I'm not sure of other scenarios where root account access would be useful. cc @marta-lokhova

marta-lokhova commented 1 month ago

the issue should track soroban upgrade loadgen modes only, where we don't need multiple accounts and can simply use the root account. right now this limitation creates unnecessary burden in the codebase/CI where we need to create accounts first before executing soroban upgrades.