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

Supports batch acquisition of hashes #11

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Supports batch acquisition of hashes #11

wants to merge 10 commits into from

Conversation

iteyelmp
Copy link
Collaborator

@iteyelmp iteyelmp commented Aug 28, 2024

Implement this issue , Provides batch acquisition of data chunk hashes to reduce the number of network requests.

For small files like those on Vitalik's blog, the optimization doesn't significantly change the time taken. However, for larger files, the optimization provides a noticeable improvement.

larger file size: 3.9 MB
Old: Time taken for getChunkHash: 0.464 minutes
New: Time taken for getChunkHashes: 0.172 minutes

Additionally, we can encapsulate the parameters required before uploading a file into a single function, retrieving them all at once to reduce network requests.
function getUploadInfo(bytes memory name) public override view returns (StorageMode mode, uint256 count, uint256 payment)

@iteyelmp iteyelmp requested review from qzhodl and syntrust August 28, 2024 06:40
contracts/ERC5018.sol Outdated Show resolved Hide resolved
@iteyelmp iteyelmp requested review from qzhodl and qizhou August 29, 2024 10:10
@qzhodl
Copy link
Contributor

qzhodl commented Aug 31, 2024

As we discussed offline, if this PR doesn’t improve performance in Vitalik’s case, we may need to involve more people for further discussion.

contracts/ERC5018.sol Outdated Show resolved Hide resolved
@iteyelmp iteyelmp requested a review from syntrust September 6, 2024 08:22
contracts/IERC5018.sol Outdated Show resolved Hide resolved
@qzhodl qzhodl requested a review from ping-ke September 24, 2024 10:20
@iteyelmp iteyelmp requested a review from qzhodl September 24, 2024 10:24
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