Skip to content

ETS integration RPC endpoints #966

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

Merged
merged 24 commits into from
Apr 26, 2021
Merged

Conversation

grale88
Copy link
Contributor

@grale88 grale88 commented Apr 15, 2021

Description

Initial integration of ETS (Ethereum tests) executed through Retesteth test suite.

Proposed Solution

Some of existing endpoints were updated according to newer changes in the runner and the tests. Additional methods were added, such as test_importRawBlock, test_getLogHash, debug_accountRangeAt and debug_storageRangeAt. Follow up tasks/bugs are created in order to ensure further progress and fixes for the tests that are failing.

Modifications were made to standard eth RPC responses because of Mantis custom fields that are avalable only when "testmode" is configured.

@grale88 grale88 force-pushed the feature/ETCM-697-retesteth-endpoints branch from 2c8c3ad to c3ce44b Compare April 15, 2021 14:18
@dzajkowski dzajkowski force-pushed the feature/ETCM-697-retesteth-endpoints branch from 2b7537d to 9dcde25 Compare April 21, 2021 13:30
{ case jv => deserializeUint256String(jv) },
PartialFunction.empty
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting seems off here

@@ -74,6 +76,7 @@ trait JsonRpcBaseController {
JsonRpcControllerMetrics.recordMethodTime(request.method, time)
}
}
.flatTap { response => Task { log.debug(s"sending response ${response.inspect}") } }
Copy link
Contributor

Choose a reason for hiding this comment

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

note: find out why there's no tap

.fold(number => blockchain.getBlockByNumber(number), hash => blockchain.getBlockByHash(hash))

if (blockOpt.isEmpty) {
Task.now(Right(AccountsInRangeResponse(Map(), ByteString(0))))
Copy link
Contributor

Choose a reason for hiding this comment

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

@jvdp do you know why this task is here? am I missing a side-effect?

Copy link
Contributor

@jvdp jvdp Apr 22, 2021

Choose a reason for hiding this comment

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

This has to be a bug and should be returned, I'm pretty sure. It would make the .gets below safe.

Copy link
Contributor

@dzajkowski dzajkowski left a comment

Choose a reason for hiding this comment

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

I don't like the intrusive paths taken (like in BlockPreaprator) but let's get this merged and move forward. Hopefully we can modularise the app and have such modules be testmode specific.

@@ -164,7 +164,7 @@ class TestService(
accountAddresses = genesisData.alloc.keys.toList
accountRangeOffset = 0

Task.now(Right(SetChainParamsResponse()))
SetChainParamsResponse().rightNow
Copy link
Contributor

Choose a reason for hiding this comment

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

Being unfamiliar to this I find this worse, somehow... but it's purely subjective.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I'm kinda surprised that the core RPC methods aren't overloaded for 'bare' (non-Task) responses. Should be possible, right?

@jvdp jvdp merged commit d1d70c2 into develop Apr 26, 2021
@jvdp jvdp deleted the feature/ETCM-697-retesteth-endpoints branch April 26, 2021 13:58
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