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

extracted configuration value for vm-queries delay #5071

Merged
merged 2 commits into from Mar 14, 2023

Conversation

bogdan-rosianu
Copy link
Contributor

Reasoning behind the pull request

  • the delay before the node allows external (API) vm queries was fixed to 2 minutes

Proposed changes

  • extracted configuration value

Testing procedure

  • play around with the VmQueryDelayAfterStartInSec value and (re)start a node. after the number of seconds specified in the config, it should accept API VM Queries. Query example:
curl --request POST \
  --url http://127.0.0.1:8080/vm-values/query \
  --header 'Content-Type: application/json' \
  --data '{
	"scAddress": "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u",
	"funcName": "getContractConfig"
}'

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@bogdan-rosianu bogdan-rosianu added area:node-api Node API type:improvement priority:4-!i&!u Not Important and not Urgent labels Mar 9, 2023
@bogdan-rosianu bogdan-rosianu self-assigned this Mar 9, 2023
@mariusmihaic mariusmihaic self-requested a review March 9, 2023 10:21
@@ -516,9 +516,13 @@ func (nr *nodeRunner) executeOneComponentCreationCycle(

log.Info("application is now running")

delayInSecBeforeAllowingVmQueries := configs.GeneralConfig.WebServerAntiflood.VmQueryDelayAfterStartInSec
if delayInSecBeforeAllowingVmQueries == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we add a warn here to specify that we override the config value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -589,6 +589,8 @@
TrieOperationsDeadlineMilliseconds = 10000
# GetAddressesBulkMaxSize represents the maximum number of addresses to be fetched in a bulk per API request. 0 means unlimited
GetAddressesBulkMaxSize = 100
# VmQueryDelayAfterStartInSec represents the number of seconds to wait when starting node before accepting vm query requests
VmQueryDelayAfterStartInSec = 5
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't 5 sec even for testnets too low for a value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used this for testing, forgot to change back. done

@sstanculeanu sstanculeanu self-requested a review March 9, 2023 10:24
Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed

@bogdan-rosianu bogdan-rosianu merged commit eddbb8b into rc/v1.6.0 Mar 14, 2023
@bogdan-rosianu bogdan-rosianu deleted the config-value-for-vm-query-delay branch March 14, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:node-api Node API priority:4-!i&!u Not Important and not Urgent type:improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants