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
fix: Don't prematurely execute time-triggers before their start
timestamp
#4333
Open
Arjentix
wants to merge
1
commit into
hyperledger:main
Choose a base branch
from
Arjentix:fix_time_trigger_first_execution_time
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: Don't prematurely execute time-triggers before their start
timestamp
#4333
Arjentix
wants to merge
1
commit into
hyperledger:main
from
Arjentix:fix_time_trigger_first_execution_time
+257
−43
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arjentix
added
Bug
Something isn't working
iroha2-dev
The re-implementation of a BFT hyperledger in RUST
labels
Feb 27, 2024
Arjentix
requested review from
s8sato,
mversic,
SamHSmith,
outoftardis,
Erigara,
0x009922,
DCNick3,
VAmuzing,
Asem-Abdelhady and
horizenight
as code owners
February 27, 2024 19:54
Arjentix
changed the title
[fix] #3262: Don't prematurely execute time-triggers before their
[fix] #3262: Don't prematurely execute time-triggers before their Feb 27, 2024
start
timestamp`start
timestamp
Arjentix
force-pushed
the
fix_time_trigger_first_execution_time
branch
from
February 27, 2024 19:55
ff6b8ac
to
160c838
Compare
Pull Request Test Coverage Report for Build 8070574387Details
💛 - Coveralls |
s8sato
reviewed
Feb 28, 2024
VAmuzing
reviewed
Feb 29, 2024
Erigara
force-pushed
the
fix_time_trigger_first_execution_time
branch
from
May 13, 2024 12:32
160c838
to
5465b6a
Compare
Erigara
changed the title
[fix] #3262: Don't prematurely execute time-triggers before their
fix: Don't prematurely execute time-triggers before their May 13, 2024
start
timestampstart
timestamp
s8sato
reviewed
May 14, 2024
Comment on lines
131
to
137
test_client.submit_blocking(register_trigger)?; | ||
|
||
let value = test_client.request(FindAssetDefinitionKeyValueByIdAndKey { | ||
id: asset_definition_id, | ||
key, | ||
let after_registration_quantity = test_client.request(FindAssetQuantityById { | ||
id: asset_id.clone(), | ||
})?; | ||
assert_eq!(value, numeric!(3).into()); | ||
// Schedule start was in the future so trigger isn't executed | ||
assert_eq!(init_quantity, after_registration_quantity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To conclude that the trigger execution was filtered out, another block than one for registering trigger would need to be committed
…estamp Signed-off-by: Daniil Polyakov <arjentix@gmail.com> Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara
force-pushed
the
fix_time_trigger_first_execution_time
branch
from
May 15, 2024 11:49
5465b6a
to
e03ee2e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api-changes
Changes in the API for client libraries
Bug
Something isn't working
iroha2-dev
The re-implementation of a BFT hyperledger in RUST
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
While original issues doesn't state it clearly I think that the problem was premature execution of time triggers.
So that trigger could be executed even before
start
. I fixed this.start
point beforelatest_block_timestamp + consensus_estimation
time, whereconsensus_estimation = 4 secs
and is a hardcoded constant. Everithing before this timestamp is considered already analyzed by Iroha. In other words -- time-triggers in the past are forbidden.start
point is in futurechange_asset_metadata_after_1_sec
testForbidding time-triggers in the past was the simpliest solution and I actually think it was making sence to implement that in the initial solution.
Linked issue
Benefits
Checklist
CONTRIBUTING.md