Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix opt.tuiEndpoint references, and entropy reloading #281

Merged
merged 5 commits into from
Nov 6, 2024
Merged

Conversation

mixmix
Copy link
Contributor

@mixmix mixmix commented Nov 6, 2024

No description provided.

Comment on lines -99 to -104
const currentAccount = entropy?.keyring?.accounts?.registration?.address
if (currentAccount && currentAccount !== storedConfig.selectedAccount) {
const currentAccount = findAccountByAddressOrName(
storedConfig.accounts,
entropy?.keyring?.accounts?.registration?.address
)
if (currentAccount && currentAccount.name !== storedConfig.selectedAccount) {
await entropy.close()
entropy = await loadEntropy(storedConfig.selectedAccount, options.tuiEndpoint);
entropy = await loadEntropy(storedConfig.selectedAccount, options.endpoint);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the major tui slowdown. selectedAccount is stored as account.name now, not account.address, so this was if (true) meaning loadEntropy was always being called another time

This doubled tui startup from 2s => 4s, which felt stink!

@mixmix
Copy link
Contributor Author

mixmix commented Nov 6, 2024

Hmm, second time I've see that in CI:

   program - deploy

    broken config: 
undefined:1


SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at deserialize (/home/runner/work/cli/cli/src/config/encoding.ts:10:17)
    at EventEmitter.<anonymous> (/home/runner/work/cli/cli/src/common/initializeEntropy.ts:69:23)

@mixmix
Copy link
Contributor Author

mixmix commented Nov 6, 2024

Have added a commit which blocks the writing of bad config (some)

src/tui.ts Outdated Show resolved Hide resolved
@mixmix mixmix merged commit 6ed98b9 into dev Nov 6, 2024
2 checks passed
@mixmix mixmix deleted the mixmix/fixes branch November 6, 2024 07:32
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants