mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 04:08:01 -05:00
bug(state-manager): fix issue with insertion filter missing in the in… (#1069)
* bug(state-manager): fix issue with insertion filter missing in the initial storage lookup * fix mimc code template --------- Co-authored-by: AlexandreBelling <alexandrebelling8@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// Code generated by gnark DO NOT EDIT
|
// Code generated by gnark DO NOT EDIT
|
||||||
pragma solidity 0.8.25;
|
pragma solidity 0.8.30;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title Library to perform MiMC hashing
|
* @title Library to perform MiMC hashing
|
||||||
|
|||||||
@@ -485,6 +485,7 @@ func storageIntegrationDefineInitial(comp *wizard.CompiledIOP, ss Module, smc Hu
|
|||||||
filterSummary,
|
filterSummary,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
filterAccountInsert := defineInsertionFilterForFinalStorage(comp, smc, sc)
|
||||||
filterEphemeralAccounts := defineEphemeralAccountFilterStorage(comp, smc, sc)
|
filterEphemeralAccounts := defineEphemeralAccountFilterStorage(comp, smc, sc)
|
||||||
// Now we define the constraints for our filters
|
// Now we define the constraints for our filters
|
||||||
comp.InsertGlobal(
|
comp.InsertGlobal(
|
||||||
@@ -496,6 +497,7 @@ func storageIntegrationDefineInitial(comp *wizard.CompiledIOP, ss Module, smc Hu
|
|||||||
sc.SelectorMinDeplBlock,
|
sc.SelectorMinDeplBlock,
|
||||||
smc.PeekAtStorage,
|
smc.PeekAtStorage,
|
||||||
smc.FirstKOCBlock,
|
smc.FirstKOCBlock,
|
||||||
|
filterAccountInsert,
|
||||||
filterEphemeralAccounts,
|
filterEphemeralAccounts,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -544,12 +546,14 @@ func storageIntegrationAssignInitial(run *wizard.ProverRuntime, ss Module, smc H
|
|||||||
}
|
}
|
||||||
svSelectorMinDeplBlock := smartvectors.NewRegular(selectorMinDeplBlock)
|
svSelectorMinDeplBlock := smartvectors.NewRegular(selectorMinDeplBlock)
|
||||||
|
|
||||||
|
filterAccountInsert := assignInsertionFilterForStorage(run, smc)
|
||||||
filterEphemeralAccounts := assignEphemeralAccountFilterStorage(run, smc)
|
filterEphemeralAccounts := assignEphemeralAccountFilterStorage(run, smc)
|
||||||
|
|
||||||
filterArith := smartvectors.Mul(
|
filterArith := smartvectors.Mul(
|
||||||
svSelectorMinDeplBlock,
|
svSelectorMinDeplBlock,
|
||||||
smc.PeekAtStorage.GetColAssignment(run),
|
smc.PeekAtStorage.GetColAssignment(run),
|
||||||
smc.FirstKOCBlock.GetColAssignment(run),
|
smc.FirstKOCBlock.GetColAssignment(run),
|
||||||
|
filterAccountInsert,
|
||||||
filterEphemeralAccounts,
|
filterEphemeralAccounts,
|
||||||
)
|
)
|
||||||
run.AssignColumn(
|
run.AssignColumn(
|
||||||
@@ -610,7 +614,7 @@ func storageIntegrationDefineFinal(comp *wizard.CompiledIOP, ss Module, smc HubC
|
|||||||
ss.Account.Address.Size(),
|
ss.Account.Address.Size(),
|
||||||
)
|
)
|
||||||
|
|
||||||
filterAccountInsert = defineInsertionFilterForFinalStorage(comp, smc, sc)
|
filterAccountInsert = comp.Columns.GetHandle("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_INSERT_FILTER")
|
||||||
filterEphemeralAccounts = comp.Columns.GetHandle("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_EPHEMERAL_FILTER")
|
filterEphemeralAccounts = comp.Columns.GetHandle("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_EPHEMERAL_FILTER")
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -692,7 +696,7 @@ func storageIntegrationAssignFinal(run *wizard.ProverRuntime, ss Module, smc Hub
|
|||||||
run.AssignColumn("FILTER_CONNECTOR_SUMMARY_ARITHMETIZATION_STORAGE_FINAL_SUMMARY", filterSummary)
|
run.AssignColumn("FILTER_CONNECTOR_SUMMARY_ARITHMETIZATION_STORAGE_FINAL_SUMMARY", filterSummary)
|
||||||
|
|
||||||
// assign the insertion filter
|
// assign the insertion filter
|
||||||
filterAccountInsert := assignInsertionFilterForFinalStorage(run, smc)
|
filterAccountInsert := run.GetColumn("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_INSERT_FILTER")
|
||||||
filterEphemeralAccounts := run.GetColumn("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_EPHEMERAL_FILTER")
|
filterEphemeralAccounts := run.GetColumn("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_EPHEMERAL_FILTER")
|
||||||
|
|
||||||
filterArith := smartvectors.Mul(
|
filterArith := smartvectors.Mul(
|
||||||
@@ -807,11 +811,11 @@ func defineInsertionFilterForFinalStorage(comp *wizard.CompiledIOP, smc HubColum
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
assignInsertionFilterForFinalStorage assigns the insertion filter for the edge case of
|
assignInsertionFilterForStorage assigns the insertion filter for the edge case of
|
||||||
missing storage keys that get created but then wiped when an account that did not exist is
|
missing storage keys that get created but then wiped when an account that did not exist is
|
||||||
not added to the state
|
not added to the state
|
||||||
*/
|
*/
|
||||||
func assignInsertionFilterForFinalStorage(run *wizard.ProverRuntime, smc HubColumnSet) smartvectors.SmartVector {
|
func assignInsertionFilterForStorage(run *wizard.ProverRuntime, smc HubColumnSet) smartvectors.SmartVector {
|
||||||
// compute the filter that detects account inserts in order to exclude those key reads from the
|
// compute the filter that detects account inserts in order to exclude those key reads from the
|
||||||
// arithmetization to state summary lookups.
|
// arithmetization to state summary lookups.
|
||||||
filterAccountInsert := make([]field.Element, smc.AddressHI.Size())
|
filterAccountInsert := make([]field.Element, smc.AddressHI.Size())
|
||||||
@@ -848,7 +852,6 @@ func assignInsertionFilterForFinalStorage(run *wizard.ProverRuntime, smc HubColu
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
svfilterAccountInsert := smartvectors.NewRegular(filterAccountInsert)
|
svfilterAccountInsert := smartvectors.NewRegular(filterAccountInsert)
|
||||||
run.AssignColumn("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_INSERT_FILTER", svfilterAccountInsert)
|
run.AssignColumn("FILTER_CONNECTOR_HUB_STATE_SUMMARY_ACCOUNT_INSERT_FILTER", svfilterAccountInsert)
|
||||||
return svfilterAccountInsert
|
return svfilterAccountInsert
|
||||||
|
|||||||
Reference in New Issue
Block a user