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

Wiring ForkedChainRef to other components #2423

Merged
merged 22 commits into from
Sep 4, 2024
Merged

Wiring ForkedChainRef to other components #2423

merged 22 commits into from
Sep 4, 2024

Conversation

jangko
Copy link
Contributor

@jangko jangko commented Jun 27, 2024

  • Disable majority of hive simulators
  • Only enable pyspec_sim for the moment
  • The pyspec_sim is using a smaller RPC service wired to ForkedChainRef
  • The RPC service will gradually grow

nimbus/rpc/server_api.nim Outdated Show resolved Hide resolved
nimbus/rpc/server_api.nim Outdated Show resolved Hide resolved
@arnetheduck
Copy link
Member

I think let's work on this in a branch until hive and/or other disabled testing works again

@jangko
Copy link
Contributor Author

jangko commented Jun 30, 2024

in hive we have 5 test suites: rpc, graphql, engine-api, consensus, and pyspec.

rpc suite and graphql are not completely related to ForkedChain. They have their own domain of problem.
Only engine-api suite and pyspec have direct dependancy to ForkedChain.
Consensus test suite although using the same test vectors as test_blockchain_json, It can be fixed separately from this branch because it's entry point is from rlp block import.

- Disable majority of hive simulators
- Only enable pyspec_sim for the moment
- The pyspec_sim is using a smaller RPC service wired to ForkedChainRef
- The RPC service will gradually grow
* Enable consensus_sim

* Remove isFile check
Comment on lines 343 to 349
db.ctx.getKvt().hasKey(genericHashKey(blockHash).toOpenArray).isOkOr:
if error.error != KvtNotFound:
warn logTxt info, blockHash, action="hasKey()", error=($$error)
return false

return true

Copy link
Contributor

Choose a reason for hiding this comment

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

hasKey() doesn't return error if blockHash is not found. So with this current implementation of hasBlockHeader, all unknown block headers are getting ignored as it thinks it is already there in the db

proc hasKey*(
db: KvtDbRef; # Database
key: openArray[byte]; # Key of database record
): Result[bool,KvtError] =
## For the argument `key` return the associated value preferably from the
## top layer, or the database otherwise.
##
if key.len == 0:
return err(KeyInvalid)
if db.layersHasKey key:
return ok(true)
let rc = db.getBe key
if rc.isOk:
return ok(true)
if rc.error == GetNotFound:
return ok(false)
err(rc.error)

@jangko jangko marked this pull request as ready for review September 3, 2024 03:23
@tersec tersec merged commit 4d9e288 into master Sep 4, 2024
26 checks passed
@tersec tersec deleted the server-api branch September 4, 2024 09:54
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.

4 participants