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

fix: downloadBlocks wasm error #1371

Merged
merged 30 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c62ca58
Update sprint 1.12 (#1341)
Hitenjain14 Dec 22, 2023
3a57362
fix trailing whitespace (#1343)
Hitenjain14 Dec 23, 2023
ad762e4
Merge staging changes (#1346)
peterlimg Dec 27, 2023
9b9fdd7
fix upload select (#1351)
Hitenjain14 Jan 4, 2024
f3ec2cc
fix workdir in mobile sdk (#1345)
Hitenjain14 Jan 4, 2024
5569b3d
set option to download to disk in wasm (#1348)
Hitenjain14 Jan 4, 2024
199dfd0
fix panic in hash chan (#1352)
Hitenjain14 Jan 4, 2024
2e55c3f
Fix merge conflict in sprint-1.12 (#1354)
Hitenjain14 Jan 4, 2024
4ed3f42
repair in batches (#1347)
Hitenjain14 Jan 4, 2024
edf037a
Merge staging (#1365)
Hitenjain14 Jan 12, 2024
c002ffc
fix: change downloadBlocks param: alloc -> allocId
ashuvssut Jan 14, 2024
e1a614f
Fix stake pool stats (#1356)
Jayashsatolia403 Jan 21, 2024
0056303
list pagination (#1368)
Hitenjain14 Jan 21, 2024
97b6a5b
Fix sync in windows (#1370)
Roshan-Mehta Jan 21, 2024
09c3757
Add option for mimeType (#1372)
Hitenjain14 Jan 21, 2024
9bc91c6
fix shutdown blobber (#1374)
boddumanohar Jan 21, 2024
6f48750
Merge remote-tracking branch 'origin/staging' into sprint-1.12
dabasov Jan 21, 2024
e7db14c
Cancel upload (#1332)
Hitenjain14 Jan 22, 2024
716e99b
Fix auth response on wasm (#1359)
peterlimg Jan 22, 2024
de8ef8c
Download buffer (#1363)
Hitenjain14 Jan 22, 2024
3186bd9
Merge branch 'sprint-1.12' into ashu/streaming
ashuvssut Jan 28, 2024
703cbd0
fix req complete cb (#1381)
Hitenjain14 Jan 29, 2024
312b5cf
get hardfork round by name (#1385)
Hitenjain14 Feb 2, 2024
5cae7a4
made GetFreeAllocationBlobbers public
dabasov Feb 2, 2024
36e5b10
fixed resp format
dabasov Feb 3, 2024
ccda3cd
fixed resp format
dabasov Feb 3, 2024
004db9d
[wasm] Expose minersc - stakePool/unstakePool collect rewards (#1386)
peterlimg Feb 4, 2024
293689e
Merge branch 'staging' into sprint-1.12
dabasov Feb 8, 2024
cab600c
Merge branch 'sprint-1.12' into ashu/streaming
dabasov Feb 10, 2024
e315634
Merge branch 'staging' into ashu/streaming
dabasov Feb 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ zcnbridge/example/logs/
winsdk/zcn.windows.h
wasmsdk/cypress/node_modules/
wasmsdk/demo/demo
sdkversion.go
gosdk.code-workspace
sdkversion
10 changes: 9 additions & 1 deletion wasmsdk/blobber.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,11 +839,19 @@ func upload(allocationID, remotePath string, fileBytes, thumbnailBytes []byte, w
}

// download download file blocks
func downloadBlocks(alloc *sdk.Allocation, remotePath, authTicket, lookupHash string, startBlock, endBlock int64) ([]byte, error) {
func downloadBlocks(allocId string, remotePath, authTicket, lookupHash string, startBlock, endBlock int64) ([]byte, error) {

if len(remotePath) == 0 && len(authTicket) == 0 {
return nil, RequiredArg("remotePath/authTicket")
}

alloc, err := getAllocation(allocId)
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to re-request the allocation if we have an object already`?

Copy link
Member Author

@ashuvssut ashuvssut Feb 4, 2024

Choose a reason for hiding this comment

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

we have an object already

The wasm logged out downloadBlocks binder not implemented because downloadBlocks wasm function did’t work when it took *sdk.Allocation as parameter

so I passed the allocId string instead of *sdk.Allocation as parameter

Copy link
Member

Choose a reason for hiding this comment

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

We cannot pass native go objects from js, so we need to pass allocationID, we have a LRU for allocations so no call will be made to sharders if alloction is already requested before.


if err != nil {
PrintError("Error fetching the allocation", err)
return nil, err
}

var (
wg = &sync.WaitGroup{}
statusBar = &StatusBar{wg: wg}
Expand Down
2 changes: 1 addition & 1 deletion wasmsdk/player_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (p *FilePlayer) download(startBlock int64) {
}
fmt.Println("start:", startBlock, "end:", endBlock, "numBlocks:", p.numBlocks, "total:", p.playlistFile.NumBlocks)

data, err := downloadBlocks(p.allocationObj, p.remotePath, p.authTicket, p.lookupHash, startBlock, endBlock)
data, err := downloadBlocks(p.allocationObj.ID, p.remotePath, p.authTicket, p.lookupHash, startBlock, endBlock)
// data, err := downloadBlocks2(int(startBlock), int(endBlock), p.allocationObj, p.remotePath)
if err != nil {
PrintError(err.Error())
Expand Down
Loading