Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
6261968
feat: initial implementation of ffi iterator
AminR443 Jul 29, 2025
071a5eb
feat: better go interface for iterator, edge case fixes
AminR443 Jul 30, 2025
28bc2a8
style: cargo fmt
AminR443 Jul 30, 2025
9d1ef4b
Merge branch 'main' into amin/ffi-iterator
AminR443 Jul 30, 2025
23f7e6d
fix: tiny issues after merge
AminR443 Jul 30, 2025
3295568
fix: test clippy error, better test case
AminR443 Jul 30, 2025
4029d20
feat: better iterator abstraction in ffi, iter_on_root
AminR443 Aug 1, 2025
96acf50
chore: only include firewood crate changes to make pr smaller
AminR443 Aug 4, 2025
0be5eb0
fix: apply suggestions, add docs, add tests
AminR443 Aug 4, 2025
316f9a3
Merge branch 'main' into amin/ffi-iterator-base
AminR443 Aug 4, 2025
338a4c9
fix: stuff from merge, style
AminR443 Aug 4, 2025
4d08b12
fix: format variable for clippy
AminR443 Aug 4, 2025
3ea4f7f
feat: better abstraction, deduplication in DbViewSyncBytes
AminR443 Aug 4, 2025
7cfa1cf
test: add tests for iterate, fix tiny issues
AminR443 Aug 5, 2025
8ec3991
ci: trigger tests
AminR443 Aug 5, 2025
40671f1
Merge branch 'main' into amin/ffi-iterator-base
AminR443 Aug 5, 2025
bde139e
test: add fuzz test for iterate
AminR443 Aug 6, 2025
b1546f2
Merge branch 'main' into amin/ffi-iterator-base
AminR443 Aug 6, 2025
3f76257
wip: new iterator
AminR443 Aug 12, 2025
74ff74b
feat: merkle_ref for supporting arc in merklenodestream
AminR443 Aug 13, 2025
236a710
merge: needed new parts from ffi-iterator-base
AminR443 Aug 13, 2025
b1586d7
fix: missed stuff, fmt
AminR443 Aug 13, 2025
bce4d7d
feat: all ffi methods initial impl
AminR443 Aug 13, 2025
4c8a2bb
feat: go ffi, tidy rust ffi and use borrowed
AminR443 Aug 13, 2025
10c9551
chore: remove go side for now
AminR443 Aug 14, 2025
a42aae2
feat: iter_on_proposal, code cleanup
AminR443 Aug 14, 2025
b17113e
todo: key value note
AminR443 Aug 14, 2025
7440a5f
feat(async-removal): Phase 1 - lint on `clippy::unused_async`
demosdemon Aug 14, 2025
84ff6ce
feat(async-removal): Phase 2 - make `Proposal` trait sync
demosdemon Aug 14, 2025
6d05477
feat(async-removal): Phase 3 - make `Db` trait sync
demosdemon Aug 14, 2025
cc95f6d
Merge branch 'main' into brandon.leblanc/remove-async-p2
demosdemon Aug 14, 2025
83a3c77
Merge branch 'brandon.leblanc/remove-async-p2' into brandon.leblanc/r…
demosdemon Aug 14, 2025
16fe8be
Merge branch 'main' into amin/ffi-iterator-new
AminR443 Aug 14, 2025
a47843b
Merge branch 'main' into brandon.leblanc/remove-async-p2
demosdemon Aug 18, 2025
e7540bf
Merge branch 'brandon.leblanc/remove-async-p2' into brandon.leblanc/r…
demosdemon Aug 18, 2025
d0d8b2b
Merge branch 'main' into brandon.leblanc/remove-async-p2
demosdemon Aug 19, 2025
f6ca77a
Merge branch 'brandon.leblanc/remove-async-p2' into brandon.leblanc/r…
demosdemon Aug 19, 2025
dd3f3cf
Merge branch 'main' into brandon.leblanc/remove-async-p3
demosdemon Aug 19, 2025
ce44145
Merge branch 'main' into amin/ffi-iterator-new
AminR443 Aug 20, 2025
c1452a3
refactor: better types
AminR443 Aug 20, 2025
eeee17e
Merge branch 'main' into brandon.leblanc/remove-async-p3
demosdemon Aug 20, 2025
f07184e
feat(async-removal): Phase 4 - Make `DbView` synchronous
demosdemon Aug 20, 2025
4d8db9d
missed some
demosdemon Aug 20, 2025
28dc159
fix metrics
demosdemon Aug 20, 2025
e330a0b
fix benchmark again
demosdemon Aug 20, 2025
89c0d9b
make tokio/prometheus optional
demosdemon Aug 20, 2025
43227dc
add grpc-testtool back (even though it's broken)
demosdemon Aug 20, 2025
2e387c2
replace DbViewSyncBytes with ArcDynDbView
demosdemon Aug 20, 2025
64ce27a
comment typo
demosdemon Aug 20, 2025
ae15477
cleanup
demosdemon Aug 20, 2025
56ab74e
remove commented code
demosdemon Aug 20, 2025
87bd241
more cleanup
demosdemon Aug 20, 2025
b1d847a
fix root ethhash
demosdemon Aug 20, 2025
bf766d1
Merge remote-tracking branch 'origin/main' into brandon.leblanc/remov…
demosdemon Aug 20, 2025
c30c847
lifetime label consistency
demosdemon Aug 20, 2025
d27fd65
extension trait
demosdemon Aug 20, 2025
628668d
Merge branch 'main' into brandon.leblanc/remove-async-p4
demosdemon Aug 20, 2025
79815d1
remove needless impls
demosdemon Aug 21, 2025
ad310a2
nit-picky change
demosdemon Aug 21, 2025
468291b
move try_extend into its own module and add test
demosdemon Aug 21, 2025
7b2279f
update test
demosdemon Aug 21, 2025
94d6dec
collapse trait bounds
demosdemon Aug 21, 2025
d034c8a
wip: merge remote-tracking branch 'origin/brandon.leblanc/remove-asyn…
AminR443 Aug 22, 2025
3a0ae2d
feat: OwnedIterView and use new sync api
AminR443 Aug 22, 2025
7dee974
feat(ffi-refactor): replace sequence id with pointer to proposals (8/8)
demosdemon Aug 22, 2025
a5ba724
Merge branch 'amin/ffi-iterator-sync' into amin/ffi-iterator-new
AminR443 Aug 23, 2025
5949620
Merge branch 'main' into amin/ffi-iterator-new
AminR443 Aug 23, 2025
1ee07d9
fix: merge errors
AminR443 Aug 23, 2025
546ffc8
Merge remote-tracking branch 'origin/brandon.leblanc/ffi-refactor' in…
AminR443 Aug 23, 2025
d80c022
feat: iterator with new ffi structure
AminR443 Aug 25, 2025
3f06f81
chore: remove irrelevant comments
AminR443 Aug 25, 2025
8020a02
fix: cargo fmt
AminR443 Aug 25, 2025
247fcad
feat: add docs, cleanup
AminR443 Aug 25, 2025
c8b88e1
fmt: .
AminR443 Aug 25, 2025
3b76b12
feat: squash merge from ffi-iterator-performance, update changes to n…
AminR443 Aug 25, 2025
cac3755
feat: iter on proposal for go, tests, fix latest revision issue
AminR443 Aug 26, 2025
9bab3d4
wip: iterator batching / rust side done
AminR443 Aug 27, 2025
a5ff253
wip: iterator batching / go side done with tests
AminR443 Aug 27, 2025
351e2f4
wip: iterator batching / better docs
AminR443 Aug 27, 2025
695db4c
feat: borrowed next
AminR443 Sep 3, 2025
f76202c
feat: better tests
AminR443 Sep 3, 2025
c54582c
feat: better test syntax
AminR443 Sep 3, 2025
ad00f20
feat: better test syntax
AminR443 Sep 3, 2025
273c64e
feat: free resources
AminR443 Sep 3, 2025
42173fb
feat: add some benchmarks
AminR443 Sep 3, 2025
8efa4bf
fmt: ...
AminR443 Sep 3, 2025
18a8d20
Merge branch 'amin/ffi-iterator-p2' into amin/ffi-iterator-p3
AminR443 Sep 3, 2025
d1fc256
fmt
AminR443 Sep 3, 2025
15bc09a
Merge branch 'amin/ffi-iterator-p3' into amin/ffi-iterator
AminR443 Sep 3, 2025
4f2c8f5
fix: remove b.Loop (go 1.23 compat)
AminR443 Sep 3, 2025
1858a9b
fix: uniform behaviour for empty db (ethhash)
AminR443 Sep 3, 2025
f8d845c
Merge branch 'amin/ffi-iterator-p2' into amin/ffi-iterator-p3
AminR443 Sep 3, 2025
6b4706d
Merge branch 'amin/ffi-iterator-p3' into amin/ffi-iterator
AminR443 Sep 3, 2025
ce94989
fix: golangci-lint issues
AminR443 Sep 3, 2025
305e46c
Merge branch 'amin/ffi-iterator-p2' into amin/ffi-iterator-p3
AminR443 Sep 3, 2025
73d5c57
fix: golangci-lint issues
AminR443 Sep 3, 2025
5b70773
Merge branch 'amin/ffi-iterator-p3' into amin/ffi-iterator
AminR443 Sep 3, 2025
d392f06
fix: golangci-lint issues
AminR443 Sep 3, 2025
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
25 changes: 23 additions & 2 deletions ffi/firewood.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ func (db *Database) Propose(keys, vals [][]byte) (*Proposal, error) {
return nil, err
}

val := C.fwd_propose_on_db(db.handle, kvp)
return newProposal(db.handle, &val)
return getProposalFromProposalResult(C.fwd_propose_on_db(db.handle, kvp), db)
}

// Get retrieves the value for the given key. It always returns a nil error.
Expand Down Expand Up @@ -199,6 +198,28 @@ func (db *Database) GetFromRoot(root, key []byte) ([]byte, error) {
))
}

// IterLatest creates and iterator starting from the provided key on the latest root hash.
// pass empty slice to start from beginning
func (db *Database) IterLatest(key []byte) (*Iterator, error) {
return db.IterOnRoot(nil, key)
}

// IterOnRoot creates and iterator starting from the provided key on a specific root hash.
// If the root is not found, it returns as an error.
// pass empty slice to start from beginning
func (db *Database) IterOnRoot(root, key []byte) (*Iterator, error) {
if db.handle == nil {
return nil, errDBClosed
}

var pinner runtime.Pinner
defer pinner.Unpin()

itResult := C.fwd_iter_on_root(db.handle, newBorrowedBytes(root, &pinner), newBorrowedBytes(key, &pinner))

return getIteratorFromIteratorResult(itResult, db)
}

// Root returns the current root hash of the trie.
// Empty trie must return common.Hash{}.
func (db *Database) Root() ([]byte, error) {
Expand Down
Loading