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

Create ScillaIPCServer #1725

Merged
merged 17 commits into from Jul 30, 2019
Merged

Create ScillaIPCServer #1725

merged 17 commits into from Jul 30, 2019

Conversation

advaypal
Copy link
Contributor

@advaypal advaypal commented Jul 17, 2019

Description

To create a jsonrpc server that will be used for communication with the Scilla executable

This is part of the larger IPC project for more efficient state communication

See branch feature/contractmap

Backward Compatibility

  • This is not a breaking change
  • This is a breaking change

Review Suggestion

Status

Implementation

  • ready for review

Integration Test (Core Team)

  • local machine test
  • small-scale cloud test

@codecov-io
Copy link

codecov-io commented Jul 17, 2019

Codecov Report

❗ No coverage uploaded for pull request base (feature/contractmap@c1275ea). Click here to learn what that means.
The diff coverage is 0%.

@@                  Coverage Diff                   @@
##             feature/contractmap    #1725   +/-   ##
======================================================
  Coverage                       ?   30.91%           
======================================================
  Files                          ?      267           
  Lines                          ?    31865           
  Branches                       ?        0           
======================================================
  Hits                           ?     9852           
  Misses                         ?    22013           
  Partials                       ?        0
Impacted Files Coverage Δ
src/libPersistence/ContractStorage2.h 0% <ø> (ø)
src/libPersistence/ContractStorage2.cpp 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1275ea...dc94b8b. Read the comment docs.

Copy link
Contributor

@vaivaswatha vaivaswatha left a comment

Choose a reason for hiding this comment

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

Look good to me so far. Please wait for @kaikawaliu 's approval before merging (to his branch).

@kaikawaliu
Copy link
Contributor

You may need to run ./build.sh style to pass the style check in travis

@vaivaswatha
Copy link
Contributor

I have cleaned up and updated the code to mimic the standalone tested toy implementation of the server (and also the client) in https://github.com/Zilliqa/ipc-experiment.

@kaikawaliu This PR is now ready to be reviewed and merged to your branch. Most of the white-space changes are due to running ./build.sh style.

@advaypal if you have the option, please make this "ready to review" rather than WIP.

}

void ScillaIPCServer::setContractAddress(dev::h160 &address) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

You might want to check with @kaikawaliu whether it is ok to remove this method, because it was after discussing with him that I had put it there.

Copy link
Contributor

Choose a reason for hiding this comment

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

m_contrAddr is a const private member. I can't imagine what advantage having an accessor for it would provide. If @kaikawaliu insists, I'll add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not an accessor, the ability to set it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would there be a situation where it needs to be set after the server object is instantiated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what needs to be checked with @kaikawaliu

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that's needed, as long as the scilla query doesn't include the address itself and we need the address to compose the index (you can see the param is needed to be fed to the ContractStorage2 functions), we have to provide the address to the ipc somehow.

Copy link
Contributor

Choose a reason for hiding this comment

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

the addr needed to be changed frequently, so the setter is needed here

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah that makes sense. I thought once the server is initialized, it will be for the same address. I'll make the change. Thank you.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kaikawaliu this is now done.

@vaivaswatha
Copy link
Contributor

@advaypal your review comments have been addressed.

@vaivaswatha vaivaswatha changed the title [WIP] Create ScillaIPCServer Create ScillaIPCServer Jul 30, 2019
@ansnunez ansnunez added this to PRs in development in Core via automation Jul 30, 2019
@vaivaswatha vaivaswatha merged commit ba27980 into feature/contractmap Jul 30, 2019
Core automation moved this from PRs in development to PRs done (merged) Jul 30, 2019
@vaivaswatha vaivaswatha deleted the feature/scilla-ipc branch July 30, 2019 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Core
  
PRs done (merged)
Development

Successfully merging this pull request may close these issues.

None yet

4 participants