Skip to content

Conversation

@TheoXD
Copy link

@TheoXD TheoXD commented Aug 19, 2022

This PR makes it so that deploys get into a block faster (within 1 minutes rather than 15 minutes) by automatically choosing one of the next two validators from the propose queue by using this API https://status.rchain.coop/api/validators. Finalization still takes quite a bit of time so improvement may not be significant.
All that is required from the user is to switch to mainnet. Switching back to any other network pauses the autoselector.
When mainnet is enabled, Transfer and Deploy buttons are disabled during the first fetch, so that user doesn't use a manually selected node.
For convenience there is a checkbox to manually disable this behavior too.

st.update(s => ({...s, nets, sel, devMode: enabled}))
}

const FetchNextValidator = async () => {
Copy link
Owner

Choose a reason for hiding this comment

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

UI controls should not have direct dependency to http requests so this functions should be in rnode-web.js file and imported together with other effects.

const sel = findValidatorByIndex(ev.target.selectedIndex)
const read = sel.name === valNode.name ? readNode : findReadOnlyByIndex(0, sel.name)
const isMainnet = sel.name === 'mainnet'
sel.name !== valNode.name ? onAutoSelectToggle({disabled: !isMainnet}) : undefined
Copy link
Owner

Choose a reason for hiding this comment

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

This is not assignment so no need to explicitly set undefined value.

sel.name !== valNode.name && onAutoSelectToggle({disabled: !isMainnet})

wallet: [], // [{name: 'My REV account', ...newRevAddress()}],
// Dev mode (show local networks)
devMode,
autoSelectDisabled: autoSelectDisabled
Copy link
Owner

Choose a reason for hiding this comment

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

Please use autoSelect as a positive meaning of the boolean field with the default false as disabled.

@tgrospic tgrospic added the enhancement New feature or request label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants