iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

[blockindex] remove DeleteTipBlock()

Open dustinxie opened this issue 2 years ago • 17 comments

Description

for most block indexers, it is not possible to remove the tip block just being added

Fixes #2645

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [x] Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules

dustinxie avatar May 04 '23 23:05 dustinxie

Starting review process for this pull request send by **None**
**Commits** in this pull request: 1

**Additions**: 9
**Changed** files: 12
**Deletions**: 167

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file action/protocol/execution/evm/evmstatedbadapter_test.go.

This model's maximum context length is 4097 tokens. However, your messages resulted in 11579 tokens. Please reduce the length of the messages.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file blockchain/blockdao/blockdao.go.

This model's maximum context length is 4097 tokens. However, you requested 6122 tokens (3050 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file blockchain/blockdao/blockindexer.go.

This model's maximum context length is 4097 tokens. However, you requested 4188 tokens (1116 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file blockindex/bloomfilterindexer.go.

This model's maximum context length is 4097 tokens. However, you requested 6976 tokens (3904 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file blockindex/indexer.go.

This model's maximum context length is 4097 tokens. However, you requested 6840 tokens (3768 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file blockindex/indexer_test.go.

This model's maximum context length is 4097 tokens. However, you requested 6628 tokens (3556 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file go.mod.

This model's maximum context length is 4097 tokens. However, you requested 7126 tokens (4054 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar May 04 '23 23:05 sonarqubecloud[bot]

🚨 Fail code review process for file go.sum.

This model's maximum context length is 4097 tokens. However, your messages resulted in 98405 tokens. Please reduce the length of the messages.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file state/factory/factory.go.

This model's maximum context length is 4097 tokens. However, your messages resulted in 6176 tokens. Please reduce the length of the messages.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file state/factory/statedb.go.

This model's maximum context length is 4097 tokens. However, your messages resulted in 4614 tokens. Please reduce the length of the messages.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file test/mock/mock_blockindex/mock_blockindex.go.

This model's maximum context length is 4097 tokens. However, you requested 4713 tokens (1641 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

🚨 Fail code review process for file test/mock/mock_factory/mock_factory.go.

This model's maximum context length is 4097 tokens. However, you requested 6127 tokens (3055 in the messages, 3072 in the completion). Please reduce the length of the messages or completion.

github-actions[bot] avatar May 04 '23 23:05 github-actions[bot]

Codecov Report

Merging #3854 (fe3c23f) into master (e1f0636) will increase coverage by 0.07%. The diff coverage is 70.85%.

:exclamation: Current head fe3c23f differs from pull request most recent head 6bfab7a. Consider uploading reports for the commit 6bfab7a to get more accurate results

@@            Coverage Diff             @@
##           master    #3854      +/-   ##
==========================================
+ Coverage   75.38%   75.45%   +0.07%     
==========================================
  Files         303      303              
  Lines       25923    25988      +65     
==========================================
+ Hits        19541    19609      +68     
+ Misses       5360     5358       -2     
+ Partials     1022     1021       -1     
Impacted Files Coverage Δ
api/web3server_marshal.go 93.21% <ø> (ø)
blockchain/blockdao/blockdao.go 69.27% <ø> (-2.64%) :arrow_down:
blockchain/blockdao/blockindexer.go 3.70% <ø> (ø)
blockindex/bloomfilterindexer.go 84.75% <ø> (+3.46%) :arrow_up:
blockindex/indexer.go 87.35% <ø> (-3.42%) :arrow_down:
api/web3server_utils.go 69.20% <16.66%> (-3.67%) :arrow_down:
state/factory/factory.go 80.74% <33.33%> (+1.40%) :arrow_up:
state/factory/statedb.go 82.50% <33.33%> (+1.76%) :arrow_up:
api/serverV2.go 86.95% <50.00%> (ø)
state/factory/workingset.go 72.69% <67.34%> (+1.27%) :arrow_up:
... and 5 more

... and 2 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar May 05 '23 00:05 codecov[bot]

What is the purpose of deleting the interface in the pr? This issue has been discussed before at https://github.com/iotexproject/iotex-core/pull/2647

Liuhaai avatar May 06 '23 17:05 Liuhaai

What is the purpose of deleting the interface in the pr? This issue has been discussed before at #2647

oh, #2647 already discussed this. The purpose is that DeleteTipBlock() is a wrong API for indexer (see #2645), and it should be removed from the code

dustinxie avatar May 10 '23 23:05 dustinxie

Close b/c it has been inactive for 1+yr.

raullenchai avatar May 30 '24 20:05 raullenchai