go-algorand
go-algorand copied to clipboard
ledger: rename "internal" package to "eval"
Summary
This will let third-party programs like indexer directly call StartEvaluator and EvaluatorOptions rather than have to place code in go-algorand to call by proxy, and should make it possible to remove evalindexer.go, as well as the indexerLedgerForEval
and indexerLedgerConnector
implementations (some of it will move to indexer).
Test Plan
Existing tests should pass — just a quick package rename.
I think I like this, I never understood the reasoning behind the internal
package. But I want to think a bit about eval
. We have two major things that we use eval
for - the evaluation of txns and the evaluation of avm programs. And then we also have an apply
package. Can anyone succinctly describe what this newly named package does? Should it just go back into ledger
? Is it about storage and lookup? (to my mind, that would make it part of ledger) or is it about applying rules of processing (to my mind that's eval
but it's also apply
).
I don't care if the meaning is perfect now, I like the simplicity of a simple package rename PR (or re-absorption into ledger
). Just trying to get the best possible name.
Perhaps this is the cow
package?
Hrmm ... well, eval
contains the BlockEvaluator, which uses layered storage "cow" types to model the environment used to evaluate each transaction, handling reads and recording writes made by each one. The apply
package contains the implementation of all transaction logic, operating inside these layered environments, which it accesses using an implementation of the apply.Balances interface implemented by eval
's "cow" storage. WDYT
Codecov Report
Merging #4272 (b529186) into master (2a933eb) will increase coverage by
0.00%
. The diff coverage is50.00%
.
@@ Coverage Diff @@
## master #4272 +/- ##
=======================================
Coverage 55.24% 55.25%
=======================================
Files 395 395
Lines 50219 50219
=======================================
+ Hits 27744 27749 +5
Misses 20093 20093
+ Partials 2382 2377 -5
Impacted Files | Coverage Δ | |
---|---|---|
ledger/eval/appcow.go | 76.14% <ø> (ø) |
|
ledger/eval/applications.go | 62.50% <ø> (ø) |
|
ledger/eval/assetcow.go | 100.00% <ø> (ø) |
|
ledger/eval/compactcert.go | 77.77% <ø> (ø) |
|
ledger/eval/cow.go | 76.63% <ø> (ø) |
|
ledger/eval/cow_creatables.go | 52.17% <ø> (ø) |
|
ledger/eval/eval.go | 67.90% <ø> (ø) |
|
ledger/eval/evalindexer.go | 0.00% <ø> (ø) |
|
ledger/eval/prefetcher/error.go | 33.33% <ø> (ø) |
|
ledger/eval/prefetcher/prefetcher.go | 68.18% <ø> (ø) |
|
... and 13 more |
Help us with your feedback. Take ten seconds to tell us how you rate us.
I don't feel strongly. Getting it out of internal
seems like a big enough win to not keep myself up about the name.
@winder please confirm that the Indexer does not need to import and call any go-algorand package.
@algorandskiy this is less important for Indexer today as it was in July. I think there are still good reasons to open it up. Tools like algojig might want to call these functions.
Thanks Will. Then maybe interested parties could refresh it.
Closing in favor of #4777