Skip to content

Update internal BLST dependency#21

Merged
tarakby merged 1 commit into
mainfrom
tarak/update-blst
Mar 20, 2025
Merged

Update internal BLST dependency#21
tarakby merged 1 commit into
mainfrom
tarak/update-blst

Conversation

@tarakby

@tarakby tarakby commented Mar 18, 2025

Copy link
Copy Markdown
Collaborator

update BLST to 0.3.14

@tarakby tarakby self-assigned this Mar 18, 2025
@tarakby tarakby changed the title update BLST to 0.3.14 Update internal BLST dependency Mar 20, 2025
Comment thread blst_src/build/srcroot.go
Comment on lines +8 to +14
var SrcRoot string

func init() {
if _, self, _, ok := runtime.Caller(0); ok {
SrcRoot = filepath.Dir(filepath.Dir(self))
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you document what this is for? I couldn't find any usages within this diff.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Files under ./blst_src and ./internal/blst/ are copied from the blst repo (though ./internal is only used for tests). The changes you see are coming from the blst repo latest changes.

Many functions copied over from blst aren't needed but isolating them makes updating the blst version more complicated. I ended up choosing to copy all the low level code over in the update instructions (the steps to update blst are detailed in this readme https://github.com/onflow/crypto/blob/tarak/update-blst/blst_src/README.md). The Go file you commented is definitely not needed in our code (it's not even built btw), only C and assembly files are needed.

Comment thread internal/blst/blst.go
type Scalar = C.blst_scalar
type Fp = C.blst_fp
type Fp2 = C.blst_fp2
type Scalar struct{ cgo C.blst_scalar }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the reason for replacing type aliases with these structs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Files under ./blst_src and ./internal/blst/ are copied from the blst repo. ./internal specifically is only used for internal tests. The Go changes you see are coming from the blst repo latest changes and are not relevant for our case.

@tarakby tarakby merged commit f402ef3 into main Mar 20, 2025
@tarakby tarakby deleted the tarak/update-blst branch March 20, 2025 22:53
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.

2 participants