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

API should check Gas And Balance when boardcast #1066

Closed
ququzone opened this issue Apr 22, 2019 · 3 comments
Closed

API should check Gas And Balance when boardcast #1066

ququzone opened this issue Apr 22, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ququzone
Copy link
Contributor

func (api *Server) SendAction(ctx context.Context, in *iotexapi.SendActionRequest) (res *iotexapi.SendActionResponse, err error) {

api should check Gas And Balance when broadcast, this can help caller find GasPrice, GasLimit, Balance Insufficient.

@ququzone ququzone added the enhancement New feature or request label Apr 22, 2019
@zjshen14
Copy link
Contributor

We check all these when adding an action into action pool. I think the optimization we could do is to switch the steps. We first try to put the action into local action pool, if error happens (not the pool/queue full issue), we should prevent sending the action other peers. Thoughts? cc @lizhefeng .

@zjshen14
Copy link
Contributor

Per discussion offline, we should change sendAction api to:

  1. Try to insert the action into local actpool
  2. If success, return the success signal to indicate the action is submitted. And then relay the action to other nodes in the network.
  3. If failure, return the failure signal (possibly with reason) to indicate the action isn't submitted.

@koseoyoung
Copy link
Contributor

same issue with #1533
merged by PR #1544

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

No branches or pull requests

4 participants