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

Add objects basic operations script and update publishContentVersion method #292

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

elv-preethi
Copy link
Collaborator

  1. testScripts/BasicObjectOperations.js: To track the time taken by create, finalize and edit content methods in tv4 or dv3.
  2. Update PublishContentVersion to:
  • manage block re-org by filtering VersionConfirm events and the object hash starting from last 10 blocks.
  • introduced a 2-minute timeout for the loop to prevent continuous retries in case events are not found.

@elv-serban
Copy link
Contributor

Noting the PublishContentVersion change addresses #287

if(awaitCommitConfirmation) {
this.Log(`Awaiting commit confirmation for ${objectHash}`);
const pollingInterval = this.ethClient.Provider().pollingInterval || 500;
const startTime = Date.now();
const duration = 2 * 60 * 1000; // 2 minutes
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't use a global timeout here because object publishing times are proportional to the size of the change (a 6 hour high-res VOD object might take 10 min to publish).

I suggest we remove this timeout at this version and we could add a timeout parameter in the future if needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure @elv-serban will make the changes.

@@ -1050,6 +1052,7 @@ exports.PublishContentVersion = async function({objectId, versionHash, awaitComm
}
}


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 an extra empty line here

@@ -1006,7 +1006,8 @@ exports.PublishContentVersion = async function({objectId, versionHash, awaitComm
});

const abi = await this.ContractAbi({id: objectId});
const fromBlock = commit.blockNumber + 1;
const fromBlock = commit.blockNumber - 10; // due to block re-org
Copy link
Contributor

Choose a reason for hiding this comment

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

We would like to make this 30 to cover the worst case observed (25 sec and 20 blocks).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

made the changes

Copy link
Contributor

@elv-serban elv-serban left a comment

Choose a reason for hiding this comment

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

Looks good!

@elv-preethi elv-preethi merged commit 0f7c531 into develop Jul 12, 2024
@elv-preethi elv-preethi deleted the basic-operations branch July 12, 2024 19:01
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.

3 participants