Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@halibobo1205
Copy link
Contributor

We can start working on computational tasks immediately without waiting for a minimum of one block to synchronize if the new reward algorithm is already in effect when the node starts.

revokingStore.disable();
revokingStore.check();
transactionCache.initCache();
rewardViCalService.init();
Copy link
Contributor

Choose a reason for hiding this comment

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

If rewardViCalService is initialized behind revokingStore.check(), is the latestBlockNumber check still necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scenes are synchronized from 0 and never restarted, check is still necessary.

if (ret) {
// checkpoint is flushed to db, we can start rewardViCalService immediately
lastBlockNumber = Long.MAX_VALUE;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need to define this variable ret.
The style needs to be consistent, lastBlockNumber -> this.lastBlockNumber

// checkpoint is flushed to db, we can start rewardViCalService immediately
lastBlockNumber = Long.MAX_VALUE;
}
es.scheduleWithFixedDelay(this::maybeRun, 0, 3, TimeUnit.SECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the significance of this code in the enableNewRewardAlgorithm function?

if (ret && lastBlockNumber == -1) {
lastBlockNumber = this.getLatestBlockHeaderNumber();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the block-catching case, record the block for which NewRewardAlgorithm is in effect, and wait for the block to be flushed before data computation to ensure data consistency.

Copy link
Contributor

@xxo1shine xxo1shine Jan 15, 2024

Choose a reason for hiding this comment

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

This function getLatestBlockHeaderNumber obtains the data of the underlying database, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

@halibobo1205 halibobo1205 merged commit 32e1e15 into tronprotocol:release_v4.7.4 Jan 15, 2024
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.4 milestone Jan 22, 2024
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.