celo-org / celo-blockchain

Official repository for the golang Celo Blockchain
https://celo.org
GNU Lesser General Public License v3.0
552 stars 196 forks source link

Allow use of "finalized" tag in rpc requests #2298

Closed piersy closed 3 months ago

piersy commented 3 months ago

This PR allows the use of the "finalized" tag to retrieve blocks or headers via the RPC. Using the "finalized" tag is equivalent to using the "latest" tag because all blocks are final in celo.

This is to supprt integration with chainlink since their system depends on retrieving finalized blocks.

Tested

There is a new e2e test that checks the "finalized" tag retrieves the same header as the "latest" tag.

github-actions[bot] commented 3 months ago

Coverage from tests in ./e2e_test/... for ./consensus/istanbul/... at commit 6c57fae9321518b1328f5af7b5fc2839e9a51179

coverage: 50.6% of statements across all listed packages
coverage:  63.2% of statements in consensus/istanbul
coverage:  42.7% of statements in consensus/istanbul/announce
coverage:  55.7% of statements in consensus/istanbul/backend
coverage:   0.0% of statements in consensus/istanbul/backend/backendtest
coverage:  24.3% of statements in consensus/istanbul/backend/internal/replica
coverage:  64.5% of statements in consensus/istanbul/core
coverage:  50.0% of statements in consensus/istanbul/db
coverage:   0.0% of statements in consensus/istanbul/proxy
coverage:  64.2% of statements in consensus/istanbul/uptime
coverage:  51.8% of statements in consensus/istanbul/validator
coverage:  79.2% of statements in consensus/istanbul/validator/random
github-actions[bot] commented 3 months ago

5882 passed, 1 failed, 45 skipped

Test failures:
  TestTransactionIndices: core

Failed
    blockchain_test.go:1946: Oldest indexded block mismatch, want 69, have 100
This test report was produced by the test-summary action.  Made with ❤️ in Cambridge.