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

Chain simulator custom transactions sender component #6182

Merged

Conversation

iulianpascalau
Copy link
Contributor

@iulianpascalau iulianpascalau commented May 20, 2024

Reasoning behind the pull request

  • the chain simulator uses the same component used by the regular node to broadcast the transactions. The default component contains an accumulator that gathers transactions for about 100 milliseconds and then dispatches them as a group of transactions. The dispatching mechanism uses a data packer to split the accumulated transactions into smaller packets (if required and if it is possible)
  • renaming the keys to pairs (related to Rename "keys" into "pairs" #6179):
    The endpoint /address/:address?withKeys=true is going to return something of this type:
type AccountResponse struct {
	Address         string            `json:"address"`
	Nonce           uint64            `json:"nonce"`
	Balance         string            `json:"balance"`
	Username        string            `json:"username"`
	Code            string            `json:"code"`
	CodeHash        []byte            `json:"codeHash"`
	RootHash        []byte            `json:"rootHash"`
	CodeMetadata    []byte            `json:"codeMetadata"`
	DeveloperReward string            `json:"developerReward"`
	OwnerAddress    string            `json:"ownerAddress"`
	Pairs           map[string]string `json:"pairs,omitempty"`
}

Merged PR: https://github.com/multiversx/mx-chain-core-go/pull/298/files

For the sake of coherence, it would be best if the chain simulator uses pairs term instead of keys.

Proposed changes

  • add a new transactions send handler that does not accumulate transactions but rather sends them directly, without delay to the network messenger. This component should be used only in the chain simulator, hence the definition and implementation in the chainSimulator package.

Testing procedure

  • standard system test (no production code involving the node was touched)
  • chain simulator tests should pass

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?

@iulianpascalau iulianpascalau changed the base branch from rc/v1.7.next1 to feat/chain-simulator-improvments May 20, 2024 13:57
@iulianpascalau iulianpascalau changed the title [WIP]Chain simulator custom transactions sender component Chain simulator custom transactions sender component May 23, 2024
@iulianpascalau iulianpascalau marked this pull request as ready for review May 23, 2024 15:29
@iulianpascalau iulianpascalau merged commit 0b138f0 into feat/chain-simulator-improvments May 27, 2024
5 of 6 checks passed
@iulianpascalau iulianpascalau deleted the chain-sim-custom-txs-sender branch May 27, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants